Commit 1468dff1 authored by Robert May's avatar Robert May

Adjust specs to cover new location

parent 6821f942
......@@ -174,6 +174,7 @@ RSpec.describe API::MergeRequestApprovals do
expect(rule_response['name']).to eq('foo')
expect(rule_response['approvers'][0]['username']).to eq(approver.username)
expect(rule_response['approved_by'][0]['username']).to eq(approver.username)
expect(rule_response['commented_by'][0]['username']).to eq(approver.username)
expect(rule_response['source_rule']).to be_nil
expect(rule_response['section']).to be_nil
end
......
......@@ -18,10 +18,6 @@ module API
expose :approved_by, using: ::API::Entities::Approvals do |merge_request|
merge_request.approvals
end
expose :commented_by, using: ::API::Entities::Approvals do |merge_request|
[]
end
end
end
end
......@@ -21,8 +21,7 @@ RSpec.describe API::Entities::MergeRequestApprovals do
approved: true,
approved_by: [{
user: API::Entities::UserBasic.new(user).as_json
}],
commented_by: []
}]
})
end
......@@ -31,8 +30,7 @@ RSpec.describe API::Entities::MergeRequestApprovals do
user_has_approved: false,
user_can_approve: true,
approved: false,
approved_by: [],
commented_by: []
approved_by: []
})
end
end
......@@ -23,19 +23,6 @@ RSpec.describe API::MergeRequestApprovals do
end
end
describe "GET :id/merge_requests/:merge_request_iid/approval_settings" do
it "retrieves the approval settings" do
project.add_developer(approver)
project.add_developer(create(:user))
create(:approval, user: approver, merge_request: merge_request)
get api("/projects/#{project.id}/merge_requests/#{merge_request.iid}/approval_settings", user)
expect(response).to have_gitlab_http_status(:ok)
end
end
describe 'POST :id/merge_requests/:merge_request_iid/approve' do
context 'as a valid approver' do
let_it_be(:approver) { create(:user) }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment