gitlab-org--gitlab-foss/spec/services/ci/expire_pipeline_cache_service_spec.rb
Toon Claes 847b9c8232
Use Etag caching for pipelines json
Enable caching in the Etag::Middleware and when a pipeline changes
status, expire the cache for the project pipelines path.
2017-04-06 23:50:36 +02:00

18 lines
545 B
Ruby

require 'spec_helper'
describe Ci::ExpirePipelineCacheService, services: true do
let(:user) { create(:user) }
let(:project) { create(:empty_project) }
let(:pipeline) { create(:ci_pipeline, project: project) }
subject { described_class.new(project, user) }
describe '#execute' do
it 'invalidate Etag caching for project pipelines path' do
path = "/#{project.full_path}/pipelines.json"
expect_any_instance_of(Gitlab::EtagCaching::Store).to receive(:touch).with(path)
subject.execute(pipeline)
end
end
end