diff options
author | Sean McGivern <sean@gitlab.com> | 2018-09-05 14:10:36 +0300 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2018-10-05 13:25:11 +0300 |
commit | b480d7121f179e93ab3cc533c4c148cbb366f7c2 (patch) | |
tree | 49c1010e1f3d4f1b78224c56daa02b77695b4e20 /spec/controllers/groups_controller_spec.rb | |
parent | ae014e189773f7299c12c1050334b3e8fe7b15d8 (diff) |
Add spec for group issues search + sorting
Diffstat (limited to 'spec/controllers/groups_controller_spec.rb')
-rw-r--r-- | spec/controllers/groups_controller_spec.rb | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/spec/controllers/groups_controller_spec.rb b/spec/controllers/groups_controller_spec.rb index 65d6cd1a295..ff27e057b31 100644 --- a/spec/controllers/groups_controller_spec.rb +++ b/spec/controllers/groups_controller_spec.rb @@ -202,8 +202,8 @@ describe GroupsController do end describe 'GET #issues' do - let(:issue_1) { create(:issue, project: project) } - let(:issue_2) { create(:issue, project: project) } + let(:issue_1) { create(:issue, project: project, title: 'foo') } + let(:issue_2) { create(:issue, project: project, title: 'bar') } before do create_list(:award_emoji, 3, awardable: issue_2) @@ -224,6 +224,26 @@ describe GroupsController do expect(assigns(:issues)).to eq [issue_2, issue_1] end end + + context 'searching' do + it 'works with popularity sort' do + get :issues, id: group.to_param, search: 'foo', sort: 'popularity' + + expect(assigns(:issues)).to eq([issue_1]) + end + + it 'works with priority sort' do + get :issues, id: group.to_param, search: 'foo', sort: 'priority' + + expect(assigns(:issues)).to eq([issue_1]) + end + + it 'works with label priority sort' do + get :issues, id: group.to_param, search: 'foo', sort: 'label_priority' + + expect(assigns(:issues)).to eq([issue_1]) + end + end end describe 'GET #merge_requests' do |