diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2018-01-03 09:21:09 +0000 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2018-01-03 09:21:09 +0000 |
commit | 5e3103678bb3ac78a9203336b2e88a8b513d3998 (patch) | |
tree | 1d71f3359ca4dd8ecfa14ba0c8b14ce2a2a063c5 /spec | |
parent | 57906a532227c86acac0e9da0ae918967b592f06 (diff) | |
parent | 017c1297cdcfbb7431dbbc0445e29d1c95d934c0 (diff) | |
download | gitlab-ce-5e3103678bb3ac78a9203336b2e88a8b513d3998.tar.gz |
Merge branch 'jprovazn-search-issues' into 'master'
Skip projects filter on issues search
See merge request gitlab-org/gitlab-ce!16117
Diffstat (limited to 'spec')
-rw-r--r-- | spec/lib/gitlab/search_results_spec.rb | 35 |
1 files changed, 28 insertions, 7 deletions
diff --git a/spec/lib/gitlab/search_results_spec.rb b/spec/lib/gitlab/search_results_spec.rb index 3dbe510b7ba..b5a9ac570e6 100644 --- a/spec/lib/gitlab/search_results_spec.rb +++ b/spec/lib/gitlab/search_results_spec.rb @@ -52,15 +52,36 @@ describe Gitlab::SearchResults do expect(results.objects('merge_requests')).to include merge_request_2 end - it 'includes project filter by default' do - expect(results).to receive(:project_ids_relation).and_call_original - results.objects('merge_requests') + describe '#merge_requests' do + it 'includes project filter by default' do + expect(results).to receive(:project_ids_relation).and_call_original + + results.objects('merge_requests') + end + + it 'it skips project filter if default project context is used' do + allow(results).to receive(:default_project_filter).and_return(true) + + expect(results).not_to receive(:project_ids_relation) + + results.objects('merge_requests') + end end - it 'it skips project filter if default is used' do - allow(results).to receive(:default_project_filter).and_return(true) - expect(results).not_to receive(:project_ids_relation) - results.objects('merge_requests') + describe '#issues' do + it 'includes project filter by default' do + expect(results).to receive(:project_ids_relation).and_call_original + + results.objects('issues') + end + + it 'it skips project filter if default project context is used' do + allow(results).to receive(:default_project_filter).and_return(true) + + expect(results).not_to receive(:project_ids_relation) + + results.objects('issues') + end end end |