diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-07-01 18:08:30 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-07-01 18:08:30 +0300 |
commit | a0fdcfcdd514c2af98f18cadfa75f8a6a85b4d2c (patch) | |
tree | ecba106fd4d1426cc2109a6ba3da091be2de1f87 /spec/controllers | |
parent | 2828f81d2a41f46b89e13dc057b982f27aeee547 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/controllers')
-rw-r--r-- | spec/controllers/projects/service_ping_controller_spec.rb | 12 | ||||
-rw-r--r-- | spec/controllers/search_controller_spec.rb | 5 |
2 files changed, 13 insertions, 4 deletions
diff --git a/spec/controllers/projects/service_ping_controller_spec.rb b/spec/controllers/projects/service_ping_controller_spec.rb index fa92efee079..22fb18edc80 100644 --- a/spec/controllers/projects/service_ping_controller_spec.rb +++ b/spec/controllers/projects/service_ping_controller_spec.rb @@ -80,16 +80,24 @@ RSpec.describe Projects::ServicePingController do it_behaves_like 'counter is not increased' it_behaves_like 'counter is increased', 'WEB_IDE_PREVIEWS_SUCCESS_COUNT' - context 'when the user has access to the project' do + context 'when the user has access to the project', :snowplow do let(:user) { project.owner } it 'increases the live preview view counter' do - expect(Gitlab::UsageDataCounters::EditorUniqueCounter).to receive(:track_live_preview_edit_action).with(author: user) + expect(Gitlab::UsageDataCounters::EditorUniqueCounter).to receive(:track_live_preview_edit_action).with(author: user, project: project) subject expect(response).to have_gitlab_http_status(:ok) end + + it_behaves_like 'Snowplow event tracking' do + let(:project) { create(:project) } + let(:category) { 'ide_edit' } + let(:action) { 'g_edit_by_live_preview' } + let(:namespace) { project.namespace } + let(:feature_flag_name) { :route_hll_to_snowplow_phase2 } + end end end diff --git a/spec/controllers/search_controller_spec.rb b/spec/controllers/search_controller_spec.rb index 66248b1194e..e4a7a2fc410 100644 --- a/spec/controllers/search_controller_spec.rb +++ b/spec/controllers/search_controller_spec.rb @@ -258,12 +258,13 @@ RSpec.describe SearchController do end it_behaves_like 'Snowplow event tracking' do + subject { get :show, params: { group_id: namespace.id, scope: 'blobs', search: 'term' } } + + let(:project) { nil } let(:category) { described_class.to_s } let(:action) { 'i_search_total' } let(:namespace) { create(:group) } let(:feature_flag_name) { :route_hll_to_snowplow_phase2 } - - subject { get :show, params: { group_id: namespace.id, scope: 'blobs', search: 'term' } } end context 'on restricted projects' do |