diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-18 22:00:14 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-18 22:00:14 +0300 |
commit | 05f0ebba3a2c8ddf39e436f412dc2ab5bf1353b2 (patch) | |
tree | 11d0f2a6ec31c7793c184106cedc2ded3d9a2cc5 /spec/helpers/search_helper_spec.rb | |
parent | ec73467c23693d0db63a797d10194da9e72a74af (diff) |
Add latest changes from gitlab-org/gitlab@15-8-stable-eev15.8.0-rc42
Diffstat (limited to 'spec/helpers/search_helper_spec.rb')
-rw-r--r-- | spec/helpers/search_helper_spec.rb | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/spec/helpers/search_helper_spec.rb b/spec/helpers/search_helper_spec.rb index 45864320115..c7afe0bf391 100644 --- a/spec/helpers/search_helper_spec.rb +++ b/spec/helpers/search_helper_spec.rb @@ -284,8 +284,24 @@ RSpec.describe SearchHelper, feature_category: :global_search do allow(self).to receive(:current_user).and_return(admin) end - it "includes admin sections" do - expect(search_autocomplete_opts("admin").size).to eq(1) + context 'when admin mode setting is disabled', :do_not_mock_admin_mode_setting do + it 'includes admin sections' do + expect(search_autocomplete_opts('admin').size).to eq(1) + end + end + + context 'when admin mode setting is enabled' do + context 'when in admin mode', :enable_admin_mode do + it 'includes admin sections' do + expect(search_autocomplete_opts('admin').size).to eq(1) + end + end + + context 'when not in admin mode' do + it 'does not include admin sections' do + expect(search_autocomplete_opts('admin').size).to eq(0) + end + end end end end |