summaryrefslogtreecommitdiff
path: root/spec/models
diff options
context:
space:
mode:
authorToon Claes <toon@gitlab.com>2017-04-04 17:38:16 +0200
committerKamil Trzcinski <ayufan@ayufan.eu>2017-04-06 23:50:36 +0200
commit847b9c82326d4fa1c4ab28f0f500a374e92728cb (patch)
tree044f6fb772c80a2604e79ebf6ffabb3610d58172 /spec/models
parentebae10467d1bfa03370d131533f2905673c03f71 (diff)
downloadgitlab-ce-847b9c82326d4fa1c4ab28f0f500a374e92728cb.tar.gz
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.
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/ci/pipeline_spec.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/models/ci/pipeline_spec.rb b/spec/models/ci/pipeline_spec.rb
index e4a24fd63c2..02c47b3efc4 100644
--- a/spec/models/ci/pipeline_spec.rb
+++ b/spec/models/ci/pipeline_spec.rb
@@ -335,6 +335,14 @@ describe Ci::Pipeline, models: true do
end
end
+ describe 'pipeline ETag caching' do
+ it 'executes ExpirePipelinesCacheService' do
+ expect_any_instance_of(Ci::ExpirePipelineCacheService).to receive(:execute).with(pipeline)
+
+ pipeline.cancel
+ end
+ end
+
def create_build(name, queued_at = current, started_from = 0)
create(:ci_build,
name: name,