diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-06-13 18:18:24 +0200 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-06-13 18:18:24 +0200 |
commit | 33db51f9154f8421dfdc2e07d04684b1c1f404d9 (patch) | |
tree | 033aaff2a8093c091fb45bbf4c1710afd6ad1594 /spec | |
parent | f6de5937e302493db2b9bcef7812ed36e1e049e6 (diff) | |
download | gitlab-ce-33db51f9154f8421dfdc2e07d04684b1c1f404d9.tar.gz |
Improve ExpireBuildArtifactsWorker spec
Diffstat (limited to 'spec')
-rw-r--r-- | spec/workers/expire_build_artifacts_worker_spec.rb | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/spec/workers/expire_build_artifacts_worker_spec.rb b/spec/workers/expire_build_artifacts_worker_spec.rb index 8168ad98062..eb8afb20275 100644 --- a/spec/workers/expire_build_artifacts_worker_spec.rb +++ b/spec/workers/expire_build_artifacts_worker_spec.rb @@ -35,18 +35,13 @@ describe ExpireBuildArtifactsWorker do end context 'for expired artifacts' do - let!(:build) { create(:ci_build, :artifacts, artifacts_expire_at: Time.now - 7.days) } + let!(:build) { create(:ci_build, artifacts_expire_at: Time.now - 7.days) } - before do - build.erase_artifacts! - build.save + it 'does not erase artifacts' do + expect_any_instance_of(Ci::Build).not_to have_received(:erase_artifacts!) end - it do - expect_any_instance_of(Ci::Build).not_to receive(:erase_artifacts!) - - worker.perform - + it 'does expire' do expect(build.reload.artifacts_expired?).to be_truthy end end |