Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions lib/gitlab/client/merge_requests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,18 @@ def merge_request_pipelines(project, id)
get("/projects/#{url_encode project}/merge_requests/#{id}/pipelines")
end

# Get a list of merge request participants.
#
# @example
# Gitlab.merge_request_participants(5, 36)
#
# @param [Integer, String] project The ID or name of a project.
# @param [Integer] id The ID of a merge request.
# @return [Array<Gitlab::ObjectifiedHash>]
def merge_request_participants(project, id)
get("/projects/#{url_encode project}/merge_requests/#{id}/participants")
end

# Creates a merge request.
#
# @example
Expand Down
18 changes: 18 additions & 0 deletions spec/fixtures/participants.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[
{
"id": 1,
"name": "John Doe1",
"username": "user1",
"state": "active",
"avatar_url": "http://www.gravatar.com/avatar/c922747a93b40d1ea88262bf1aebee62?s=80&d=identicon",
"web_url": "http://localhost/user1"
},
{
"id": 2,
"name": "John Doe2",
"username": "user2",
"state": "active",
"avatar_url": "http://www.gravatar.com/avatar/10fc7f102be8de7657fb4d80898bbfe3?s=80&d=identicon",
"web_url": "http://localhost/user2"
}
]
10 changes: 10 additions & 0 deletions spec/gitlab/client/merge_requests_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,16 @@
end
end

describe '.merge_request_participants' do
before do
stub_get('/projects/3/merge_requests/1/participants', 'participants')
Gitlab.merge_request_participants(3, 1)
end

it 'gets the correct resource' do
expect(a_get('/projects/3/merge_requests/1/participants')).to have_been_made
end
end
describe '.merge_request_pipelines' do
before do
stub_get('/projects/3/merge_requests/1/pipelines', 'pipelines')
Expand Down