diff options
author | Adam Niedzielski <adamsunday@gmail.com> | 2017-04-03 16:17:04 +0300 |
---|---|---|
committer | Adam Niedzielski <adamsunday@gmail.com> | 2017-04-03 16:17:04 +0300 |
commit | 9543025e88d3d0fe298e95330b8d38802da50cc6 (patch) | |
tree | e96e1a10a4ba6cba5cade8cd959b3894b8e67cd8 /spec/lib/gitlab/etag_caching | |
parent | 2faf955c241ce7e99111f8fd0cae2e7ab6167e5a (diff) |
Introduce "polling_interval_multiplier" as application setting
Implement module for setting "Poll-Interval" response header.
Return 429 in ETag caching middleware when polling is disabled.
Diffstat (limited to 'spec/lib/gitlab/etag_caching')
-rw-r--r-- | spec/lib/gitlab/etag_caching/middleware_spec.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/lib/gitlab/etag_caching/middleware_spec.rb b/spec/lib/gitlab/etag_caching/middleware_spec.rb index 8b5bfc4dbb0..6ec4360adc2 100644 --- a/spec/lib/gitlab/etag_caching/middleware_spec.rb +++ b/spec/lib/gitlab/etag_caching/middleware_spec.rb @@ -99,6 +99,19 @@ describe Gitlab::EtagCaching::Middleware do middleware.call(build_env(path, if_none_match)) end + + context 'when polling is disabled' do + before do + allow(Gitlab::PollingInterval).to receive(:polling_enabled?). + and_return(false) + end + + it 'returns status code 429' do + status, _, _ = middleware.call(build_env(path, if_none_match)) + + expect(status).to eq 429 + end + end end context 'when If-None-Match header does not match ETag in store' do |