diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-30 21:08:07 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-30 21:08:07 +0300 |
commit | 2c72daf2f1744f2b8c8c6674c266907e9ef55558 (patch) | |
tree | e489b6e87557d3f6d8a94f2e7d4d47e633d646b5 /spec/views/admin | |
parent | 4e9acbfba3682c552b3de707c535e6257ef41054 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/views/admin')
-rw-r--r-- | spec/views/admin/application_settings/general.html.haml_spec.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/spec/views/admin/application_settings/general.html.haml_spec.rb b/spec/views/admin/application_settings/general.html.haml_spec.rb index e6a0307afd9..d8ca5dd1b49 100644 --- a/spec/views/admin/application_settings/general.html.haml_spec.rb +++ b/spec/views/admin/application_settings/general.html.haml_spec.rb @@ -33,4 +33,32 @@ describe 'admin/application_settings/general.html.haml' do end end end + + describe 'Maintenance mode' do + let(:maintenance_mode_flag) { true } + + before do + assign(:application_setting, app_settings) + stub_feature_flags(maintenance_mode: maintenance_mode_flag) + allow(view).to receive(:current_user).and_return(user) + end + + context 'when maintenance_mode feature is enabled' do + it 'show the Maintenance mode section' do + render + + expect(rendered).to have_css('#js-maintenance-mode-toggle') + end + end + + context 'when maintenance_mode feature is disabled' do + let(:maintenance_mode_flag) { false } + + it 'hide the Maintenance mode section' do + render + + expect(rendered).not_to have_css('#js-maintenance-mode-toggle') + end + end + end end |