diff options
Diffstat (limited to 'spec/models/commit_status_spec.rb')
-rw-r--r-- | spec/models/commit_status_spec.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/models/commit_status_spec.rb b/spec/models/commit_status_spec.rb index f7583645e69..4fd330ab7dc 100644 --- a/spec/models/commit_status_spec.rb +++ b/spec/models/commit_status_spec.rb @@ -443,4 +443,24 @@ describe CommitStatus do end end end + + describe 'set failure_reason when drop' do + let(:build) { create(:ci_build, :created) } + + before do + build.drop!(reason) + end + + context 'when failure_reason is nil' do + let(:reason) { } + + it { expect(build).to be_unknown_failure } + end + + context 'when failure_reason is job_failure' do + let(:reason) { :job_failure } + + it { expect(build).to be_job_failure } + end + end end |