diff options
author | Jarka Kadlecova <jarka@gitlab.com> | 2017-09-15 09:04:21 +0300 |
---|---|---|
committer | Jarka Kadlecova <jarka@gitlab.com> | 2017-09-15 09:04:21 +0300 |
commit | 740d158019480f41d0b1e528d0d42c9441d2c2ac (patch) | |
tree | 593440a5df388437380869ea2038d13d33f4c8a3 /spec/helpers/auto_devops_helper_spec.rb | |
parent | 7533bda8a804e6c2d6054eef7a5c3c37c606ea21 (diff) | |
parent | d8bf06926eb67a02bea039261589df5fd2c2fbb6 (diff) |
Merge branch '10-0-stable-prepare-rc3' into '10-0-stable'
Prepare 10.0 RC3 release
See merge request gitlab-org/gitlab-ce!14266
Diffstat (limited to 'spec/helpers/auto_devops_helper_spec.rb')
-rw-r--r-- | spec/helpers/auto_devops_helper_spec.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/helpers/auto_devops_helper_spec.rb b/spec/helpers/auto_devops_helper_spec.rb index b6d892548ef..5e272af6073 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' @@ -55,5 +65,21 @@ describe AutoDevopsHelper do it { is_expected.to eq(false) } end + + context 'when master contains a .gitlab-ci.yml file' do + before do + allow(project.repository).to receive(:gitlab_ci_yml).and_return("script: ['test']") + end + + it { is_expected.to eq(false) } + end + + context 'when another service is enabled' do + before do + create(:service, project: project, category: :ci, active: true) + end + + it { is_expected.to eq(false) } + end end end |