Commit b5eb3f77 authored by Alper Akgun's avatar Alper Akgun

Add context to "trial during signup" experiment

parent 9d227686
......@@ -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