diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-03 21:09:00 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-03 21:09:00 +0000 |
commit | 71c9d577ad563572050335dc261ba7673e3e566f (patch) | |
tree | dcb4bb47b2d843de160feffe26dcefe20403f3fc /spec/models/ci/build_spec.rb | |
parent | 63a015fd85ae35634eb882d0078e65d80300816c (diff) | |
download | gitlab-ce-71c9d577ad563572050335dc261ba7673e3e566f.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models/ci/build_spec.rb')
-rw-r--r-- | spec/models/ci/build_spec.rb | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/spec/models/ci/build_spec.rb b/spec/models/ci/build_spec.rb index 4f729f2546c..f0f6556deec 100644 --- a/spec/models/ci/build_spec.rb +++ b/spec/models/ci/build_spec.rb @@ -2338,14 +2338,24 @@ describe Ci::Build do end end - describe '#has_expiring_artifacts?' do + describe '#has_expiring_archive_artifacts?' do context 'when artifacts have expiration date set' do before do build.update(artifacts_expire_at: 1.day.from_now) end - it 'has expiring artifacts' do - expect(build).to have_expiring_artifacts + context 'and job artifacts archive record exists' do + let!(:archive) { create(:ci_job_artifact, :archive, job: build) } + + it 'has expiring artifacts' do + expect(build).to have_expiring_archive_artifacts + end + end + + context 'and job artifacts archive record does not exist' do + it 'does not have expiring artifacts' do + expect(build).not_to have_expiring_archive_artifacts + end end end @@ -2355,7 +2365,7 @@ describe Ci::Build do end it 'does not have expiring artifacts' do - expect(build).not_to have_expiring_artifacts + expect(build).not_to have_expiring_archive_artifacts end end end |