diff options
author | Rémy Coutable <remy@rymai.me> | 2018-10-02 10:09:12 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2018-10-02 10:09:12 +0000 |
commit | 974fe0797079f4f7ddc57b45d15ee7d39a06e78a (patch) | |
tree | 0dfcc09e301ef2dab1fa43b07295e7d118dc4a33 /spec | |
parent | af0178aa3a59e587aeaea2c8e87e0f5529ddb589 (diff) | |
parent | 10534e31622242ee6d6ad4d5502e1f2808979b43 (diff) | |
download | gitlab-ce-974fe0797079f4f7ddc57b45d15ee7d39a06e78a.tar.gz |
Merge branch '41205-fix-filtering-issues' into 'master'
Filter issues without an Assignee via the API
Closes #41205
See merge request gitlab-org/gitlab-ce!22009
Diffstat (limited to 'spec')
-rw-r--r-- | spec/finders/issues_finder_spec.rb | 8 | ||||
-rw-r--r-- | spec/requests/api/issues_spec.rb | 9 |
2 files changed, 17 insertions, 0 deletions
diff --git a/spec/finders/issues_finder_spec.rb b/spec/finders/issues_finder_spec.rb index 07a2fa86dd7..d78451112ec 100644 --- a/spec/finders/issues_finder_spec.rb +++ b/spec/finders/issues_finder_spec.rb @@ -56,6 +56,14 @@ describe IssuesFinder do end end + context 'filtering by no assignee' do + let(:params) { { assignee_id: 0 } } + + it 'returns issues not assign to any assignee' do + expect(issues).to contain_exactly(issue4) + end + end + context 'filtering by group_id' do let(:params) { { group_id: group.id } } diff --git a/spec/requests/api/issues_spec.rb b/spec/requests/api/issues_spec.rb index f64815feffa..1e2e13a723c 100644 --- a/spec/requests/api/issues_spec.rb +++ b/spec/requests/api/issues_spec.rb @@ -168,6 +168,15 @@ describe API::Issues do expect(first_issue['id']).to eq(issue2.id) end + it 'returns issues with no assignee' do + issue2 = create(:issue, author: user2, project: project) + + get api('/issues', user), assignee_id: 0, scope: 'all' + + expect_paginated_array_response(size: 1) + expect(first_issue['id']).to eq(issue2.id) + end + it 'returns issues reacted by the authenticated user by the given emoji' do issue2 = create(:issue, project: project, author: user, assignees: [user]) award_emoji = create(:award_emoji, awardable: issue2, user: user2, name: 'star') |