Commit 1f149dde authored by Peter Leitzen's avatar Peter Leitzen

Merge branch 'nicolasdular/fix-invite-mail-tracking' into 'master'

Fix snowplow tracking event error for new user invite page

See merge request gitlab-org/gitlab!40628
parents e4a9dc0b a52a0622
......@@ -108,7 +108,7 @@ class InvitesController < ApplicationController
Gitlab::Experimentation::EXPERIMENTS[:invite_email][:tracking_category],
action,
property: property,
value: Digest::MD5.hexdigest(member.to_global_id.to_s)
label: Digest::MD5.hexdigest(member.to_global_id.to_s)
)
end
end
---
title: Fix snowplow tracking event error for new user invite page
merge_request: 40628
author:
type: fixed
......@@ -10,6 +10,7 @@ RSpec.describe InvitesController do
let(:md5_member_global_id) { Digest::MD5.hexdigest(member.to_global_id.to_s) }
before do
stub_application_setting(snowplow_enabled: true, snowplow_collector_hostname: 'localhost')
controller.instance_variable_set(:@member, member)
sign_in(user)
end
......@@ -51,17 +52,17 @@ RSpec.describe InvitesController do
let(:params) { { id: token, new_user_invite: 'experiment' } }
it 'tracks the user as experiment group' do
expect(Gitlab::Tracking).to receive(:event).with(
expect(Gitlab::Tracking).to receive(:event).and_call_original.with(
'Growth::Acquisition::Experiment::InviteEmail',
'opened',
property: 'experiment_group',
value: md5_member_global_id
label: md5_member_global_id
)
expect(Gitlab::Tracking).to receive(:event).with(
expect(Gitlab::Tracking).to receive(:event).and_call_original.with(
'Growth::Acquisition::Experiment::InviteEmail',
'accepted',
property: 'experiment_group',
value: md5_member_global_id
label: md5_member_global_id
)
request
......@@ -72,17 +73,17 @@ RSpec.describe InvitesController do
let(:params) { { id: token, new_user_invite: 'control' } }
it 'tracks the user as control group' do
expect(Gitlab::Tracking).to receive(:event).with(
expect(Gitlab::Tracking).to receive(:event).and_call_original.with(
'Growth::Acquisition::Experiment::InviteEmail',
'opened',
property: 'control_group',
value: md5_member_global_id
label: md5_member_global_id
)
expect(Gitlab::Tracking).to receive(:event).with(
expect(Gitlab::Tracking).to receive(:event).and_call_original.with(
'Growth::Acquisition::Experiment::InviteEmail',
'accepted',
property: 'control_group',
value: md5_member_global_id
label: md5_member_global_id
)
request
......@@ -107,11 +108,11 @@ RSpec.describe InvitesController do
let(:params) { { id: token, new_user_invite: 'experiment' } }
it 'tracks the user as experiment group' do
expect(Gitlab::Tracking).to receive(:event).with(
expect(Gitlab::Tracking).to receive(:event).and_call_original.with(
'Growth::Acquisition::Experiment::InviteEmail',
'accepted',
property: 'experiment_group',
value: md5_member_global_id
label: md5_member_global_id
)
request
......@@ -122,11 +123,11 @@ RSpec.describe InvitesController do
let(:params) { { id: token, new_user_invite: 'control' } }
it 'tracks the user as control group' do
expect(Gitlab::Tracking).to receive(:event).with(
expect(Gitlab::Tracking).to receive(:event).and_call_original.with(
'Growth::Acquisition::Experiment::InviteEmail',
'accepted',
property: 'control_group',
value: md5_member_global_id
label: md5_member_global_id
)
request
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment