diff options
Diffstat (limited to 'spec/lib/gitlab/etag_caching/middleware_spec.rb')
-rw-r--r-- | spec/lib/gitlab/etag_caching/middleware_spec.rb | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/spec/lib/gitlab/etag_caching/middleware_spec.rb b/spec/lib/gitlab/etag_caching/middleware_spec.rb index da5eaf2e4ab..fa0b3d1c6dd 100644 --- a/spec/lib/gitlab/etag_caching/middleware_spec.rb +++ b/spec/lib/gitlab/etag_caching/middleware_spec.rb @@ -123,7 +123,15 @@ RSpec.describe Gitlab::EtagCaching::Middleware, :clean_gitlab_redis_shared_state format: :html, method: 'GET', path: enabled_path, - status: status_code + status: status_code, + request_urgency: :medium, + target_duration_s: 0.5, + metadata: a_hash_including( + { + 'meta.caller_id' => 'Projects::NotesController#index', + 'meta.feature_category' => 'team_planning' + } + ) } end @@ -172,10 +180,11 @@ RSpec.describe Gitlab::EtagCaching::Middleware, :clean_gitlab_redis_shared_state expect(headers).to include('X-Gitlab-From-Cache' => 'true') end - it "pushes route's feature category to the context" do + it "pushes expected information in to the context" do expect(Gitlab::ApplicationContext).to receive(:push).with( feature_category: 'team_planning', - caller_id: 'Projects::NotesController#index' + caller_id: 'Projects::NotesController#index', + remote_ip: '127.0.0.1' ) _, _, _ = middleware.call(build_request(path, if_none_match)) @@ -291,7 +300,8 @@ RSpec.describe Gitlab::EtagCaching::Middleware, :clean_gitlab_redis_shared_state { 'PATH_INFO' => path, 'HTTP_IF_NONE_MATCH' => if_none_match, 'rack.input' => '', - 'REQUEST_METHOD' => 'GET' } + 'REQUEST_METHOD' => 'GET', + 'REMOTE_ADDR' => '127.0.0.1' } end def payload_for(event) |