summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorToon Claes <toon@gitlab.com>2017-04-05 14:27:49 +0200
committerKamil Trzcinski <ayufan@ayufan.eu>2017-04-06 23:50:36 +0200
commit751dae58e6a536e410e0cf254527fa27e43c154c (patch)
tree74140055063700e20ccaad1c90a530e87214d2ba /spec
parent847b9c82326d4fa1c4ab28f0f500a374e92728cb (diff)
downloadgitlab-ce-751dae58e6a536e410e0cf254527fa27e43c154c.tar.gz
In case of Etag cache hit, the body should be empty
Diffstat (limited to 'spec')
-rw-r--r--spec/lib/gitlab/etag_caching/middleware_spec.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/lib/gitlab/etag_caching/middleware_spec.rb b/spec/lib/gitlab/etag_caching/middleware_spec.rb
index c872d8232b0..24df04e985a 100644
--- a/spec/lib/gitlab/etag_caching/middleware_spec.rb
+++ b/spec/lib/gitlab/etag_caching/middleware_spec.rb
@@ -91,6 +91,12 @@ describe Gitlab::EtagCaching::Middleware do
expect(status).to eq 304
end
+ it 'returns empty body' do
+ _, _, body = middleware.call(build_env(path, if_none_match))
+
+ expect(body).to be_empty
+ end
+
it 'tracks "etag_caching_cache_hit" event' do
expect(Gitlab::Metrics).to receive(:add_event)
.with(:etag_caching_middleware_used, endpoint: 'issue_notes')