diff options
Diffstat (limited to 'spec/lib/gitlab/etag_caching/middleware_spec.rb')
-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 |