diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-20 16:18:24 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-20 16:18:24 +0300 |
commit | 0653e08efd039a5905f3fa4f6e9cef9f5d2f799c (patch) | |
tree | 4dcc884cf6d81db44adae4aa99f8ec1233a41f55 /spec/controllers/search_controller_spec.rb | |
parent | 744144d28e3e7fddc117924fef88de5d9674fe4c (diff) |
Add latest changes from gitlab-org/gitlab@14-3-stable-eev14.3.0-rc42
Diffstat (limited to 'spec/controllers/search_controller_spec.rb')
-rw-r--r-- | spec/controllers/search_controller_spec.rb | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/spec/controllers/search_controller_spec.rb b/spec/controllers/search_controller_spec.rb index e0870e17d99..4e87a9fc1ba 100644 --- a/spec/controllers/search_controller_spec.rb +++ b/spec/controllers/search_controller_spec.rb @@ -182,6 +182,37 @@ RSpec.describe SearchController do end end end + + context 'tab feature flags' do + subject { get :show, params: { scope: scope, search: 'term' }, format: :html } + + where(:feature_flag, :scope) do + :global_search_code_tab | 'blobs' + :global_search_issues_tab | 'issues' + :global_search_merge_requests_tab | 'merge_requests' + :global_search_wiki_tab | 'wiki_blobs' + :global_search_commits_tab | 'commits' + end + + with_them do + it 'returns 200 if flag is enabled' do + stub_feature_flags(feature_flag => true) + + subject + + expect(response).to have_gitlab_http_status(:ok) + end + + it 'redirects with alert if flag is disabled' do + stub_feature_flags(feature_flag => false) + + subject + + expect(response).to redirect_to search_path + expect(controller).to set_flash[:alert].to(/Global Search is disabled for this scope/) + end + end + end end it 'finds issue comments' do |