diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-23 15:09:47 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-23 15:09:47 +0300 |
commit | 8f9beefac3774b30e911fb00a68f4c7a5244cf27 (patch) | |
tree | 919c3a043f8c10bc3f78f3f6e029acfb6b972556 /spec/models/concerns | |
parent | e4bf776a8829e5186a0f63603c0be627b891d80e (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models/concerns')
-rw-r--r-- | spec/models/concerns/optionally_search_spec.rb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/spec/models/concerns/optionally_search_spec.rb b/spec/models/concerns/optionally_search_spec.rb index ff4212ddf18..71cf536db89 100644 --- a/spec/models/concerns/optionally_search_spec.rb +++ b/spec/models/concerns/optionally_search_spec.rb @@ -22,12 +22,22 @@ describe OptionallySearch do it 'delegates to the search method' do expect(model) .to receive(:search) - .with('foo') + .with('foo', {}) model.optionally_search('foo') end end + context 'when an option is provided' do + it 'delegates to the search method' do + expect(model) + .to receive(:search) + .with('foo', some_option: true) + + model.optionally_search('foo', some_option: true) + end + end + context 'when no query is given' do it 'returns the current relation' do expect(model.optionally_search).to be_a_kind_of(ActiveRecord::Relation) |