Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct API endpoint for project approvers #489

Merged
merged 1 commit into from
Mar 1, 2019
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
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