Commit 33db51f9 authored by Kamil Trzcinski's avatar Kamil Trzcinski

Improve ExpireBuildArtifactsWorker spec

parent f6de5937
...@@ -35,18 +35,13 @@ describe ExpireBuildArtifactsWorker do ...@@ -35,18 +35,13 @@ describe ExpireBuildArtifactsWorker do
end end
context 'for expired artifacts' do 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 it 'does not erase artifacts' do
build.erase_artifacts! expect_any_instance_of(Ci::Build).not_to have_received(:erase_artifacts!)
build.save
end end
it do it 'does expire' do
expect_any_instance_of(Ci::Build).not_to receive(:erase_artifacts!)
worker.perform
expect(build.reload.artifacts_expired?).to be_truthy expect(build.reload.artifacts_expired?).to be_truthy
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment