diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-14 18:08:31 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-14 18:08:31 +0000 |
commit | 92f95ccac81911d1fcc32e999a7f1ce04624a56c (patch) | |
tree | ad207e86b7858ae93a085fbdc04155f5cd469620 /spec/controllers | |
parent | 85e494935a8726dc98bb19ffa584488420e5011e (diff) | |
download | gitlab-ce-92f95ccac81911d1fcc32e999a7f1ce04624a56c.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/controllers')
-rw-r--r-- | spec/controllers/search_controller_spec.rb | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/spec/controllers/search_controller_spec.rb b/spec/controllers/search_controller_spec.rb index 1559a50d016..ca7b8a4036a 100644 --- a/spec/controllers/search_controller_spec.rb +++ b/spec/controllers/search_controller_spec.rb @@ -106,8 +106,8 @@ describe SearchController do context 'check search term length' do let(:search_queries) do - char_limit = controller.class::NON_ES_SEARCH_CHAR_LIMIT - term_limit = controller.class::NON_ES_SEARCH_TERM_LIMIT + char_limit = SearchService::SEARCH_CHAR_LIMIT + term_limit = SearchService::SEARCH_TERM_LIMIT { chars_under_limit: ('a' * (char_limit - 1)), chars_over_limit: ('a' * (char_limit + 1)), @@ -116,21 +116,15 @@ describe SearchController do } end - where(:es_enabled, :string_name, :expectation) do - true | :chars_under_limit | :not_to_set_flash - true | :chars_over_limit | :not_to_set_flash - true | :terms_under_limit | :not_to_set_flash - true | :terms_over_limit | :not_to_set_flash - false | :chars_under_limit | :not_to_set_flash - false | :chars_over_limit | :set_chars_flash - false | :terms_under_limit | :not_to_set_flash - false | :terms_over_limit | :set_terms_flash + where(:string_name, :expectation) do + :chars_under_limit | :not_to_set_flash + :chars_over_limit | :set_chars_flash + :terms_under_limit | :not_to_set_flash + :terms_over_limit | :set_terms_flash end with_them do it do - allow(Gitlab::CurrentSettings).to receive(:elasticsearch_search?).and_return(es_enabled) - get :show, params: { scope: 'projects', search: search_queries[string_name] } case expectation |