diff options
Diffstat (limited to 'spec/controllers')
-rw-r--r-- | spec/controllers/graphql_controller_spec.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/controllers/graphql_controller_spec.rb b/spec/controllers/graphql_controller_spec.rb index be47b32ec4f..6a09c5cb823 100644 --- a/spec/controllers/graphql_controller_spec.rb +++ b/spec/controllers/graphql_controller_spec.rb @@ -234,6 +234,16 @@ RSpec.describe GraphqlController, feature_category: :integrations do post :execute end + it 'calls the track visual studio extension api when trackable method' do + agent = 'code-completions-language-server-experiment (gl-visual-studio-extension:1.0.0.0; arch:X64;)' + request.env['HTTP_USER_AGENT'] = agent + + expect(Gitlab::UsageDataCounters::VisualStudioExtensionActivityUniqueCounter) + .to receive(:track_api_request_when_trackable).with(user_agent: agent, user: user) + + post :execute + end + context 'if using the GitLab CLI' do it 'call trackable for the old UserAgent' do agent = 'GLab - GitLab CLI' @@ -379,6 +389,16 @@ RSpec.describe GraphqlController, feature_category: :integrations do subject end + it 'calls the track visual studio extension api when trackable method' do + agent = 'code-completions-language-server-experiment (gl-visual-studio-extension:1.0.0.0; arch:X64;)' + request.env['HTTP_USER_AGENT'] = agent + + expect(Gitlab::UsageDataCounters::VisualStudioExtensionActivityUniqueCounter) + .to receive(:track_api_request_when_trackable).with(user_agent: agent, user: user) + + subject + end + it 'calls the track gitlab cli when trackable method' do agent = 'GLab - GitLab CLI' request.env['HTTP_USER_AGENT'] = agent |