diff options
author | Shinya Maeda <shinya@gitlab.com> | 2018-11-29 08:51:03 +0300 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2018-11-29 08:51:03 +0300 |
commit | af5bf56857bd6e88bc9ea3322a0873ff6767de69 (patch) | |
tree | 206afaf4ef6cbe958d69d730f179651d621302c2 /spec/services/ci | |
parent | 3fbd48e127053517e9ee0f6307989758a4d59f9a (diff) |
Improve spec
Diffstat (limited to 'spec/services/ci')
-rw-r--r-- | spec/services/ci/archive_trace_service_spec.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/services/ci/archive_trace_service_spec.rb b/spec/services/ci/archive_trace_service_spec.rb index 6389d7a921f..989aab60113 100644 --- a/spec/services/ci/archive_trace_service_spec.rb +++ b/spec/services/ci/archive_trace_service_spec.rb @@ -11,6 +11,18 @@ describe Ci::ArchiveTraceService, '#execute' do expect(job.reload.job_artifacts_trace).to be_exist end + + context 'when trace is already archived' do + let!(:job) { create(:ci_build, :success, :trace_artifact) } + + it 'ignores an exception' do + expect { subject }.not_to raise_error + end + + it 'does not create an archived trace' do + expect { subject }.not_to change { Ci::JobArtifact.trace.count } + end + end end context 'when job is running' do |