diff options
author | Valery Sizov <valery@gitlab.com> | 2017-05-05 18:55:16 +0300 |
---|---|---|
committer | Valery Sizov <valery@gitlab.com> | 2017-05-05 18:55:16 +0300 |
commit | 0cfe35f7279e7b6618c10be91908c29cd7ab110a (patch) | |
tree | 69b9ef3167b78ce42e6178358e05d90e78856840 /spec/requests/api/issues_spec.rb | |
parent | 9c0f2485b5d7fed5b538313e5bf867110273c004 (diff) | |
download | gitlab-ce-0cfe35f7279e7b6618c10be91908c29cd7ab110a.tar.gz |
Multiple issue assignee: CE restriction for multiple assignees
Diffstat (limited to 'spec/requests/api/issues_spec.rb')
-rw-r--r-- | spec/requests/api/issues_spec.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/requests/api/issues_spec.rb b/spec/requests/api/issues_spec.rb index 9b7b5798b71..da2b56c040b 100644 --- a/spec/requests/api/issues_spec.rb +++ b/spec/requests/api/issues_spec.rb @@ -772,6 +772,17 @@ describe API::Issues do end end + context 'CE restrictions' do + it 'creates a new project issue with no more than one assignee' do + post api("/projects/#{project.id}/issues", user), + title: 'new issue', assignee_ids: [user2.id, guest.id] + + expect(response).to have_http_status(201) + expect(json_response['title']).to eq('new issue') + expect(json_response['assignees'].count).to eq(1) + end + end + it 'creates a new project issue' do post api("/projects/#{project.id}/issues", user), title: 'new issue', labels: 'label, label2', weight: 3, @@ -1111,6 +1122,17 @@ describe API::Issues do expect(json_response['assignees'].first['name']).to eq(user2.name) end + + context 'CE restrictions' do + it 'updates an issue with several assignee but only one has been applied' do + put api("/projects/#{project.id}/issues/#{issue.iid}", user), + assignee_ids: [user2.id, guest.id] + + expect(response).to have_http_status(200) + + expect(json_response['assignees'].size).to eq(1) + end + end end describe 'PUT /projects/:id/issues/:issue_iid to update labels' do |