require'spec_helper'describeExpireJobCacheWorkerdoset(:pipeline){create(:ci_empty_pipeline)}let(:project){pipeline.project}subject{described_class.new}describe'#perform'docontext'with a job in the pipeline'dolet(:job){create(:ci_build,pipeline: pipeline)}it'invalidates Etag caching for the job path'dopipeline_path="/#{project.full_path}/pipelines/#{pipeline.id}.json"job_path="/#{project.full_path}/builds/#{job.id}.json"expect_any_instance_of(Gitlab::EtagCaching::Store).toreceive(:touch).with(pipeline_path)expect_any_instance_of(Gitlab::EtagCaching::Store).toreceive(:touch).with(job_path)subject.perform(job.id)endendcontext'when there is no job in the pipeline'doit'does not change the etag store'doexpect(Gitlab::EtagCaching::Store).not_toreceive(:new)subject.perform(9999)endendendend