diff options
author | Heinrich Lee Yu <hleeyu@gmail.com> | 2018-10-25 12:19:12 +0300 |
---|---|---|
committer | Heinrich Lee Yu <hleeyu@gmail.com> | 2018-10-26 05:32:14 +0300 |
commit | 006631f8823c1dfe43cc7b9ed7e47a11a3d3809c (patch) | |
tree | fea83c67443dd8b0217d287c2b5ca4295e074c7c /spec | |
parent | 227e30f7feb2072407a231a762835bf8d5103129 (diff) |
Apply similar change to MRs API
Diffstat (limited to 'spec')
-rw-r--r-- | spec/requests/api/issues_spec.rb | 3 | ||||
-rw-r--r-- | spec/requests/api/merge_requests_spec.rb | 17 |
2 files changed, 20 insertions, 0 deletions
diff --git a/spec/requests/api/issues_spec.rb b/spec/requests/api/issues_spec.rb index 090e8eac768..9cda39a569b 100644 --- a/spec/requests/api/issues_spec.rb +++ b/spec/requests/api/issues_spec.rb @@ -188,6 +188,9 @@ describe API::Issues do end it 'returns issues with any assignee' do + # This issue without assignee should not be returned + create(:issue, author: user2, project: project) + get api('/issues', user), assignee_id: 'Any', scope: 'all' expect_paginated_array_response(size: 3) diff --git a/spec/requests/api/merge_requests_spec.rb b/spec/requests/api/merge_requests_spec.rb index 07d19e3ad29..e4e0ca285e0 100644 --- a/spec/requests/api/merge_requests_spec.rb +++ b/spec/requests/api/merge_requests_spec.rb @@ -143,6 +143,23 @@ describe API::MergeRequests do expect_response_ordered_exactly(merge_request3) end + it 'returns an array of merge requests with no assignee' do + merge_request3 = create(:merge_request, :simple, author: user, source_project: project2, target_project: project2, source_branch: 'other-branch') + + get api('/merge_requests', user), assignee_id: 'None', scope: :all + + expect_response_ordered_exactly(merge_request3) + end + + it 'returns an array of merge requests with any assignee' do + # This MR with no assignee should not be returned + create(:merge_request, :simple, author: user, source_project: project2, target_project: project2, source_branch: 'other-branch') + + get api('/merge_requests', user), assignee_id: 'Any', scope: :all + + expect_response_contain_exactly(merge_request, merge_request2, merge_request_closed, merge_request_merged, merge_request_locked) + end + it 'returns an array of merge requests assigned to me' do merge_request3 = create(:merge_request, :simple, author: user, assignee: user2, source_project: project2, target_project: project2, source_branch: 'other-branch') |