Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-07-20 03:09:58 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-07-20 03:09:58 +0300
commit3c25c55bf591097e96170c2d2da1b40d295cc981 (patch)
tree5418c6aa14eb79619079d1aa7918ae27d6600d46 /spec/controllers
parentc991a74ffd36af636f3083fed93c0f6e81746f02 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/controllers')
-rw-r--r--spec/controllers/graphql_controller_spec.rb20
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