diff options
Diffstat (limited to 'spec/models/ci/build_spec.rb')
-rw-r--r-- | spec/models/ci/build_spec.rb | 16 |
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 |