diff options
Diffstat (limited to 'spec/requests/api/search_spec.rb')
-rw-r--r-- | spec/requests/api/search_spec.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/requests/api/search_spec.rb b/spec/requests/api/search_spec.rb index 4d2a69cd85b..66b78829e0d 100644 --- a/spec/requests/api/search_spec.rb +++ b/spec/requests/api/search_spec.rb @@ -350,6 +350,17 @@ RSpec.describe API::Search do include_examples 'pagination', scope: :snippet_titles end end + + it 'sets global search information for logging' do + expect(Gitlab::Instrumentation::GlobalSearchApi).to receive(:set_information).with( + type: 'basic', + level: 'global', + scope: 'issues', + search_duration_s: a_kind_of(Numeric) + ) + + get api(endpoint, user), params: { scope: 'issues', search: 'john doe' } + end end it_behaves_like 'rate limited endpoint', rate_limit_key: :search_rate_limit do |