diff options
Diffstat (limited to 'spec/models/ci/job_artifact_spec.rb')
-rw-r--r-- | spec/models/ci/job_artifact_spec.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/models/ci/job_artifact_spec.rb b/spec/models/ci/job_artifact_spec.rb index 796947be4c8..cdb123573f1 100644 --- a/spec/models/ci/job_artifact_spec.rb +++ b/spec/models/ci/job_artifact_spec.rb @@ -195,6 +195,22 @@ RSpec.describe Ci::JobArtifact do end end + describe '#archived_trace_exists?' do + subject { artifact.archived_trace_exists? } + + context 'when the file exists' do + it { is_expected.to be_truthy } + end + + context 'when the file does not exist' do + before do + artifact.file.remove! + end + + it { is_expected.to be_falsy } + end + end + describe '.for_sha' do let(:first_pipeline) { create(:ci_pipeline) } let(:second_pipeline) { create(:ci_pipeline, project: first_pipeline.project, sha: Digest::SHA1.hexdigest(SecureRandom.hex)) } |