Skip to content

Commit

Permalink
Merge pull request #489 from jasonwbarnett/bugfix/merge_request_appro…
Browse files Browse the repository at this point in the history
…vals

Correct API endpoint for project approvers
  • Loading branch information
NARKOZ authored Mar 1, 2019
2 parents 6c03cdf + 1003dca commit 5c61984
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/gitlab/client/merge_request_approvals.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def project_merge_request_approvals(project)
# @option options [Boolean] :disable_overriding_approvers_per_merge_request(optional) Allow/Disallow overriding approvers per MR
# @return [Gitlab::ObjectifiedHash] MR approval configuration information about the project
def edit_project_merge_request_approvals(project, options = {})
post("/projects/#{url_encode project}/approvals", body: options)
post("/projects/#{url_encode project}/approvers", body: options)
end

# Change allowed approvers and approver groups for a project
Expand Down
4 changes: 2 additions & 2 deletions spec/gitlab/client/merge_request_approvals_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
describe '.edit_project_merge_request_approvals' do
before do
body = { approvals_before_merge: '3', reset_approvals_on_push: 'false', disable_overriding_approvers_per_merge_request: 'true' }
stub_post('/projects/1/approvals', 'project_merge_request_approvals').with(body: body)
stub_post('/projects/1/approvers', 'project_merge_request_approvals').with(body: body)
@project_mr_approvals = Gitlab.edit_project_merge_request_approvals(1, approvals_before_merge: 3, reset_approvals_on_push: false, disable_overriding_approvers_per_merge_request: true)
end

it 'gets the correct resource' do
body = { approvals_before_merge: '3', reset_approvals_on_push: 'false', disable_overriding_approvers_per_merge_request: 'true' }
expect(a_post('/projects/1/approvals')
expect(a_post('/projects/1/approvers')
.with(body: body)).to have_been_made
end

Expand Down

0 comments on commit 5c61984

Please sign in to comment.