Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-13 21:09:00 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-13 21:09:00 +0300
commite4dffdfe364af6c72dcb6b4671cb39a24e8e100c (patch)
tree6428a1c3472b14396645dcb280b219dbc0420c66 /spec/workers
parent0ab47b994caa80c5587f33dc818626b66cfdafe2 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/workers')
-rw-r--r--spec/workers/expire_pipeline_cache_worker_spec.rb15
1 files changed, 12 insertions, 3 deletions
diff --git a/spec/workers/expire_pipeline_cache_worker_spec.rb b/spec/workers/expire_pipeline_cache_worker_spec.rb
index e162a227a66..8d898ffc13e 100644
--- a/spec/workers/expire_pipeline_cache_worker_spec.rb
+++ b/spec/workers/expire_pipeline_cache_worker_spec.rb
@@ -3,9 +3,9 @@
require 'spec_helper'
describe ExpirePipelineCacheWorker do
- let(:user) { create(:user) }
- let(:project) { create(:project) }
- let(:pipeline) { create(:ci_pipeline, project: project) }
+ let_it_be(:user) { create(:user) }
+ let_it_be(:project) { create(:project) }
+ let_it_be(:pipeline) { create(:ci_pipeline, project: project) }
subject { described_class.new }
@@ -22,5 +22,14 @@ describe ExpirePipelineCacheWorker do
subject.perform(617748)
end
+
+ it "doesn't do anything if the pipeline cannot be cached" do
+ allow_any_instance_of(Ci::Pipeline).to receive(:cacheable?).and_return(false)
+
+ expect_any_instance_of(Ci::ExpirePipelineCacheService).not_to receive(:execute)
+ expect_any_instance_of(Gitlab::EtagCaching::Store).not_to receive(:touch)
+
+ subject.perform(pipeline.id)
+ end
end
end