diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-09 15:09:48 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-09 15:09:48 +0300 |
commit | 3c53fbc50bf8d084f1184836468850d2a83ef920 (patch) | |
tree | 85c451a4082e7b5e8dc3ecb6265edb1aef0b14f0 /spec/views/layouts | |
parent | e7462f7b49a60b2ee7be14682c23190f7f7c5ba7 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/views/layouts')
-rw-r--r-- | spec/views/layouts/profile.html.haml_spec.rb | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/spec/views/layouts/profile.html.haml_spec.rb b/spec/views/layouts/profile.html.haml_spec.rb new file mode 100644 index 00000000000..93f8a075209 --- /dev/null +++ b/spec/views/layouts/profile.html.haml_spec.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe 'layouts/profile' do + let(:user) { create(:user) } + + before do + allow(view).to receive(:session).and_return({}) + allow(view).to receive(:current_user).and_return(user) + allow(view).to receive(:current_user_mode).and_return(Gitlab::Auth::CurrentUserMode.new(user)) + allow(view).to receive(:experiment_enabled?).and_return(false) + allow(view).to receive(:enable_search_settings).and_call_original + end + + it 'calls enable_search_settings helper with a custom container class' do + render + expect(view).to have_received(:enable_search_settings) + .with({ locals: { container_class: 'gl-my-5' } }) + end + + context 'when search_settings_in_page feature flag is on' do + it 'displays the search settings entry point' do + render + expect(rendered).to include('js-search-settings-app') + end + end + + context 'when search_settings_in_page feature flag is off' do + before do + stub_feature_flags(search_settings_in_page: false) + end + + it 'does not display the search settings entry point' do + render + expect(rendered).not_to include('js-search-settings-app') + end + end +end |