847b9c8232
Enable caching in the Etag::Middleware and when a pipeline changes status, expire the cache for the project pipelines path.
18 lines
545 B
Ruby
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
|