summaryrefslogtreecommitdiff
path: root/spec/models/ci/build_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-12-10 07:53:40 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-12-10 07:53:40 +0000
commitcfc792b9ca064990e6540cb742e80529ea669a81 (patch)
tree147cd4256319990cebbc02fe8e4fbbbe06f5720a /spec/models/ci/build_spec.rb
parent93c6764dacd4c605027ef1cd367d3aebe420b223 (diff)
downloadgitlab-ce-cfc792b9ca064990e6540cb742e80529ea669a81.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models/ci/build_spec.rb')
-rw-r--r--spec/models/ci/build_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/models/ci/build_spec.rb b/spec/models/ci/build_spec.rb
index 03340f34305..acc54338a10 100644
--- a/spec/models/ci/build_spec.rb
+++ b/spec/models/ci/build_spec.rb
@@ -4113,4 +4113,20 @@ describe Ci::Build do
end
end
end
+
+ describe '#environment_auto_stop_in' do
+ subject { build.environment_auto_stop_in }
+
+ context 'when build option has environment auto_stop_in' do
+ let(:build) { create(:ci_build, options: { environment: { name: 'test', auto_stop_in: '1 day' } }) }
+
+ it { is_expected.to eq('1 day') }
+ end
+
+ context 'when build option does not have environment auto_stop_in' do
+ let(:build) { create(:ci_build) }
+
+ it { is_expected.to be_nil }
+ end
+ end
end