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-12-10 10:53:40 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-12-10 10:53:40 +0300
commitcfc792b9ca064990e6540cb742e80529ea669a81 (patch)
tree147cd4256319990cebbc02fe8e4fbbbe06f5720a /spec/lib/gitlab/ci
parent93c6764dacd4c605027ef1cd367d3aebe420b223 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/ci')
-rw-r--r--spec/lib/gitlab/ci/config/entry/environment_spec.rb29
1 files changed, 29 insertions, 0 deletions
diff --git a/spec/lib/gitlab/ci/config/entry/environment_spec.rb b/spec/lib/gitlab/ci/config/entry/environment_spec.rb
index c80b54bd6be..8c21d5342cc 100644
--- a/spec/lib/gitlab/ci/config/entry/environment_spec.rb
+++ b/spec/lib/gitlab/ci/config/entry/environment_spec.rb
@@ -206,6 +206,35 @@ describe Gitlab::Ci::Config::Entry::Environment do
end
end
+ context 'when auto_stop_in is specified' do
+ let(:config) do
+ {
+ name: 'review/$CI_COMMIT_REF_NAME',
+ url: 'https://$CI_COMMIT_REF_NAME.review.gitlab.com',
+ on_stop: 'stop_review',
+ auto_stop_in: auto_stop_in
+ }
+ end
+
+ context 'when auto_stop_in is correct format' do
+ let(:auto_stop_in) { '2 days' }
+
+ it 'becomes valid' do
+ expect(entry).to be_valid
+ expect(entry.auto_stop_in).to eq(auto_stop_in)
+ end
+ end
+
+ context 'when auto_stop_in is invalid format' do
+ let(:auto_stop_in) { 'invalid' }
+
+ it 'becomes invalid' do
+ expect(entry).not_to be_valid
+ expect(entry.errors).to include 'environment auto stop in should be a duration'
+ end
+ end
+ end
+
context 'when configuration is invalid' do
context 'when configuration is an array' do
let(:config) { ['env'] }