Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-11-21 18:06:17 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-11-21 18:06:17 +0300
commitb5ad06174bb1de39438c90847abb86ac6988e944 (patch)
tree1bb386b92f023fd2a8f776ccc10386675b3b1ef9 /spec/models/project_auto_devops_spec.rb
parent0a6ffb540e569bd7a7c548d59b12bc55d4bf9cf1 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models/project_auto_devops_spec.rb')
-rw-r--r--spec/models/project_auto_devops_spec.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/spec/models/project_auto_devops_spec.rb b/spec/models/project_auto_devops_spec.rb
index da9e56ef897..2a821b20aa8 100644
--- a/spec/models/project_auto_devops_spec.rb
+++ b/spec/models/project_auto_devops_spec.rb
@@ -23,7 +23,8 @@ describe ProjectAutoDevops do
[
{ key: 'INCREMENTAL_ROLLOUT_MODE', value: 'manual' },
{ key: 'STAGING_ENABLED', value: '1' },
- { key: 'INCREMENTAL_ROLLOUT_ENABLED', value: '1' }
+ { key: 'INCREMENTAL_ROLLOUT_ENABLED', value: '1' },
+ { key: 'AUTO_DEVOPS_EXPLICITLY_ENABLED', value: '1' }
]
end
@@ -33,6 +34,8 @@ describe ProjectAutoDevops do
context 'when deploy_strategy is continuous' do
let(:auto_devops) { build_stubbed(:project_auto_devops, :continuous_deployment, project: project) }
+ it { expect(auto_devops.predefined_variables).to include(key: 'AUTO_DEVOPS_EXPLICITLY_ENABLED', value: '1') }
+
it do
expect(auto_devops.predefined_variables.map { |var| var[:key] })
.not_to include("STAGING_ENABLED", "INCREMENTAL_ROLLOUT_ENABLED")
@@ -44,11 +47,19 @@ describe ProjectAutoDevops do
it { expect(auto_devops.predefined_variables).to include(key: 'INCREMENTAL_ROLLOUT_MODE', value: 'timed') }
+ it { expect(auto_devops.predefined_variables).to include(key: 'AUTO_DEVOPS_EXPLICITLY_ENABLED', value: '1') }
+
it do
expect(auto_devops.predefined_variables.map { |var| var[:key] })
.not_to include("STAGING_ENABLED", "INCREMENTAL_ROLLOUT_ENABLED")
end
end
+
+ context 'when auto-devops is explicitly disabled' do
+ let(:auto_devops) { build_stubbed(:project_auto_devops, :disabled, project: project) }
+
+ it { expect(auto_devops.predefined_variables.to_hash).to be_empty }
+ end
end
describe '#create_gitlab_deploy_token' do