Extract EE specific files/lines for Verify spec/workers

We have the following files containing EE specific code. We should move them to ee/

spec/workers/expire_pipeline_cache_worker_spec.rb
diff --git a/spec/workers/expire_pipeline_cache_worker_spec.rb b/home/yorickpeterse/Projects/gitlab/gdk-ee/gitlab/spec/workers/expire_pipeline_cache_worker_spec.rb
index 54c9a69d329..8afcdd0f372 100644
--- a/spec/workers/expire_pipeline_cache_worker_spec.rb
+++ b/home/yorickpeterse/Projects/gitlab/gdk-ee/gitlab/spec/workers/expire_pipeline_cache_worker_spec.rb
@@ -42,5 +42,34 @@ describe ExpirePipelineCacheWorker do
 
       subject.perform(pipeline.id)
     end
+
+    context 'when pipeline is triggered by other pipeline' do
+      let(:pipeline) { create(:ci_empty_pipeline) }
+      let(:source) { create(:ci_sources_pipeline, pipeline: pipeline) }
+
+      it 'updates the cache of dependent pipeline' do
+        dependent_pipeline_path = "/#{source.source_project.full_path}/pipelines/#{source.source_pipeline.id}.json"
+
+        allow_any_instance_of(Gitlab::EtagCaching::Store).to receive(:touch)
+        expect_any_instance_of(Gitlab::EtagCaching::Store).to receive(:touch).with(dependent_pipeline_path)
+
+        subject.perform(pipeline.id)
+      end
+    end
+
+    context 'when pipeline triggered other pipeline' do
+      let(:pipeline) { create(:ci_empty_pipeline) }
+      let(:build) { create(:ci_build, pipeline: pipeline) }
+      let(:source) { create(:ci_sources_pipeline, source_job: build) }
+
+      it 'updates the cache of dependent pipeline' do
+        dependent_pipeline_path = "/#{source.project.full_path}/pipelines/#{source.pipeline.id}.json"
+
+        allow_any_instance_of(Gitlab::EtagCaching::Store).to receive(:touch)
+        expect_any_instance_of(Gitlab::EtagCaching::Store).to receive(:touch).with(dependent_pipeline_path)
+
+        subject.perform(pipeline.id)
+      end
+    end
   end
 end
Assignee Loading
Time tracking Loading