diff options
author | Markus Doits <markus.doits@stellenticket.de> | 2018-09-15 13:39:55 +0200 |
---|---|---|
committer | Markus Doits <markus.doits@stellenticket.de> | 2018-11-07 13:00:38 +0100 |
commit | 473b52b2837bfffc634f574f148d949e218137ed (patch) | |
tree | e63cda26538ddfe356334b30771f9511bb3ed706 /spec | |
parent | d71a779740d1f667892e9bef798961e2a39a3a9c (diff) | |
download | gitlab-ce-473b52b2837bfffc634f574f148d949e218137ed.tar.gz |
add an option when to retry a build (unused yet)
Diffstat (limited to 'spec')
-rw-r--r-- | spec/models/ci/build_spec.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/models/ci/build_spec.rb b/spec/models/ci/build_spec.rb index 88a466317a5..ba1de3612ad 100644 --- a/spec/models/ci/build_spec.rb +++ b/spec/models/ci/build_spec.rb @@ -1512,6 +1512,32 @@ describe Ci::Build do end end end + + describe '#retry_when' do + context 'when value is defined' do + subject { create(:ci_build, options: { retry: { when: :something } }) } + + it 'returns the configured value' do + expect(subject.retry_when).to eq :something + end + end + + context 'when value is not defined' do + subject { create(:ci_build) } + + it 'returns `always`' do + expect(subject.retry_when).to eq :always + end + end + + context 'when retry is only defined as an integer' do + subject { create(:ci_build, options: { retry: 1 }) } + + it 'returns `always`' do + expect(subject.retry_when).to eq :always + end + end + end end describe '#keep_artifacts!' do |