summaryrefslogtreecommitdiff
path: root/spec/helpers/auto_devops_helper_spec.rb
diff options
context:
space:
mode:
authorZeger-Jan van de Weg <git@zjvandeweg.nl>2017-09-12 14:00:50 +0200
committerZeger-Jan van de Weg <git@zjvandeweg.nl>2017-09-12 14:22:56 +0200
commitb1d5186d0a2d8ea2b594398fbcfe28acb3e8ed23 (patch)
tree5bc558fcdf7564cbaa584ddabf70cd169c66e033 /spec/helpers/auto_devops_helper_spec.rb
parent7e992b0be12da8906da04dd4c11c4ae2b01299bc (diff)
downloadgitlab-ce-b1d5186d0a2d8ea2b594398fbcfe28acb3e8ed23.tar.gz
Allow all AutoDevOps banners to be disabled
Given the default in the development and production environment is false, the negation of enabling is used in the flag to signal you'd turn it off. It reads a bit awkward, but makes us have a migration less. Fixes gitlab-org/gitlab-ce#37653
Diffstat (limited to 'spec/helpers/auto_devops_helper_spec.rb')
-rw-r--r--spec/helpers/auto_devops_helper_spec.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/helpers/auto_devops_helper_spec.rb b/spec/helpers/auto_devops_helper_spec.rb
index b6d892548ef..80d58ff6bf7 100644
--- a/spec/helpers/auto_devops_helper_spec.rb
+++ b/spec/helpers/auto_devops_helper_spec.rb
@@ -10,6 +10,8 @@ describe AutoDevopsHelper do
before do
allow(helper).to receive(:can?).with(user, :admin_pipeline, project) { allowed }
allow(helper).to receive(:current_user) { user }
+
+ Feature.get(:auto_devops_banner_disabled).disable
end
subject { helper.show_auto_devops_callout?(project) }
@@ -18,6 +20,14 @@ describe AutoDevopsHelper do
it { is_expected.to eq(true) }
end
+ context 'when the banner is disabled by feature flag' do
+ it 'allows the feature flag to disable' do
+ Feature.get(:auto_devops_banner_disabled).enable
+
+ expect(subject).to be(false)
+ end
+ end
+
context 'when dismissed' do
before do
helper.request.cookies[:auto_devops_settings_dismissed] = 'true'