Commit 23a95b1a authored by Shinya Maeda's avatar Shinya Maeda

Merge branch 'aa-add-context-to-trial-during-signup-experiment-tracking' into 'master'

Add context to "trial during signup" experiment

See merge request gitlab-org/gitlab!51907
parents 679b81e8 b5eb3f77
......@@ -29,7 +29,7 @@ module Registrations
url_params[:trial_onboarding_flow] = true
else
record_experiment_user(:trial_during_signup, trial_chosen: trial)
record_experiment_user(:trial_during_signup, trial_chosen: trial, namespace_id: @group.id)
if experiment_enabled?(:trial_during_signup)
if trial
......
......@@ -104,7 +104,11 @@ RSpec.describe Registrations::GroupsController do
it { is_expected.to redirect_to(new_users_sign_up_project_path(namespace_id: user.groups.last.id, trial: false)) }
it 'calls the record user trial_during_signup experiment' do
expect(controller).to receive(:record_experiment_user).with(:trial_during_signup, trial_chosen: false)
group = create(:group)
expect_next_instance_of(Groups::CreateService) do |service|
expect(service).to receive(:execute).and_return(group)
end
expect(controller).to receive(:record_experiment_user).with(:trial_during_signup, trial_chosen: false, namespace_id: group.id)
subject
end
......@@ -180,7 +184,12 @@ RSpec.describe Registrations::GroupsController do
let_it_be(:trial_form_params) { { trial: 'false' } }
it 'calls the record user trial_during_signup experiment' do
expect(controller).to receive(:record_experiment_user).with(:trial_during_signup, trial_chosen: false)
group = create(:group)
expect_next_instance_of(Groups::CreateService) do |service|
expect(service).to receive(:execute).and_return(group)
end
expect(controller).to receive(:record_experiment_user).with(:trial_during_signup, trial_chosen: false, namespace_id: group.id)
subject
end
......
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