Commit 8faf01c0 authored by Alex Kalderimis's avatar Alex Kalderimis Committed by Alex Kalderimis

Add REST specs for clearing assignees

parent efa43a73
......@@ -2154,7 +2154,7 @@ RSpec.describe API::MergeRequests do
end
end
describe 'PUT /projects/:id/merge_reuests/:merge_request_iid' do
describe 'PUT /projects/:id/merge_requests/:merge_request_iid' do
it_behaves_like 'issuable update endpoint' do
let(:entity) { merge_request }
end
......@@ -2176,6 +2176,36 @@ RSpec.describe API::MergeRequests do
end
end
context 'when only assignee_ids are provided, and the list is empty' do
let(:params) do
{
assignee_ids: []
}
end
it 'clears the assignees' do
put api("/projects/#{project.id}/merge_requests/#{merge_request.iid}", user), params: params
expect(response).to have_gitlab_http_status(:ok)
expect(json_response['assignees']).to be_empty )
end
end
context 'when only assignee_ids are provided, and the list is contains the sentinel value' do
let(:params) do
{
assignee_ids: [0]
}
end
it 'clears the assignees' do
put api("/projects/#{project.id}/merge_requests/#{merge_request.iid}", user), params: params
expect(response).to have_gitlab_http_status(:ok)
expect(json_response['assignees']).to be_empty )
end
end
context 'accepts reviewer_ids' do
let(:params) do
{
......
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