diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-09-20 14:18:08 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-09-20 14:18:08 +0300 |
commit | 5afcbe03ead9ada87621888a31a62652b10a7e4f (patch) | |
tree | 9918b67a0d0f0bafa6542e839a8be37adf73102d /spec/views/layouts/_page.html.haml_spec.rb | |
parent | c97c0201564848c1f53226fe19d71fdcc472f7d0 (diff) |
Add latest changes from gitlab-org/gitlab@16-4-stable-eev16.4.0-rc42
Diffstat (limited to 'spec/views/layouts/_page.html.haml_spec.rb')
-rw-r--r-- | spec/views/layouts/_page.html.haml_spec.rb | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/spec/views/layouts/_page.html.haml_spec.rb b/spec/views/layouts/_page.html.haml_spec.rb new file mode 100644 index 00000000000..da9d086efe0 --- /dev/null +++ b/spec/views/layouts/_page.html.haml_spec.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe 'layouts/_page', feature_category: :geo_replication do + let_it_be(:user) { build_stubbed(:user) } + + describe '_silent_mode_banner' do + before do + allow(view).to receive(:current_user).and_return(user) + allow(view).to receive(:current_user_mode).and_return(Gitlab::Auth::CurrentUserMode.new(user)) + end + + describe 'when ::Gitlab::SilentMode.enabled? is true' do + before do + allow(::Gitlab::SilentMode).to receive(:enabled?).and_return(true) + end + + it 'renders silent mode banner' do + render + + expect(rendered).to have_text('Silent mode is enabled') + end + end + + describe 'when ::Gitlab::SilentMode.enabled? is false' do + before do + allow(::Gitlab::SilentMode).to receive(:enabled?).and_return(false) + end + + it 'does not silent mode banner' do + render + + expect(rendered).not_to have_text('Silent mode is enabled') + end + end + end +end |