summaryrefslogtreecommitdiff
path: root/spec/views
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-30 18:08:07 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-30 18:08:07 +0000
commit2c72daf2f1744f2b8c8c6674c266907e9ef55558 (patch)
treee489b6e87557d3f6d8a94f2e7d4d47e633d646b5 /spec/views
parent4e9acbfba3682c552b3de707c535e6257ef41054 (diff)
downloadgitlab-ce-2c72daf2f1744f2b8c8c6674c266907e9ef55558.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/views')
-rw-r--r--spec/views/admin/application_settings/general.html.haml_spec.rb28
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