diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-06-10 22:45:06 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2016-06-13 13:09:19 +0300 |
commit | 421be01dabb13cd1f45d0118b4e1be9d33baef61 (patch) | |
tree | f886bfcadb224a9c8d7cc28ed77ec918e3052f29 /spec/workers/expire_build_artifacts_worker_spec.rb | |
parent | 9281709b41ce5be5637194cda191a6dd76ddd495 (diff) |
Improve design based on review
Diffstat (limited to 'spec/workers/expire_build_artifacts_worker_spec.rb')
-rw-r--r-- | spec/workers/expire_build_artifacts_worker_spec.rb | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/spec/workers/expire_build_artifacts_worker_spec.rb b/spec/workers/expire_build_artifacts_worker_spec.rb index 64a55e8c587..501ca630e55 100644 --- a/spec/workers/expire_build_artifacts_worker_spec.rb +++ b/spec/workers/expire_build_artifacts_worker_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe ExpireBuildArtifactsWorker do include RepoHelpers - let(:worker) { ExpireBuildArtifactsWorker.new } + let(:worker) { described_class.new } describe '#perform' do context 'with expired artifacts' do @@ -11,9 +11,10 @@ describe ExpireBuildArtifactsWorker do it do expect_any_instance_of(Ci::Build).to receive(:erase_artifacts!) + worker.perform - build.reload - expect(build.artifacts_expired?).to be_truthy + + expect(build.reload.artifacts_expired?).to be_truthy end end @@ -22,9 +23,10 @@ describe ExpireBuildArtifactsWorker do it do expect_any_instance_of(Ci::Build).not_to receive(:erase_artifacts!) + worker.perform - build.reload - expect(build.artifacts_expired?).to be_falsey + + expect(build.reload.artifacts_expired?).to be_falsey end end @@ -33,6 +35,7 @@ describe ExpireBuildArtifactsWorker do it do expect_any_instance_of(Ci::Build).not_to receive(:erase_artifacts!) + worker.perform end end @@ -47,9 +50,10 @@ describe ExpireBuildArtifactsWorker do it do expect_any_instance_of(Ci::Build).not_to receive(:erase_artifacts!) + worker.perform - build.reload - expect(build.artifacts_expired?).to be_truthy + + expect(build.reload.artifacts_expired?).to be_truthy end end end |