Commit c9c5d97c authored by Jarka Košanová's avatar Jarka Košanová

Merge branch 'aa-namespace-context-for-remove-known-fields-from-trial-form' into 'master'

Add namespace context for upcoming experiments

See merge request gitlab-org/gitlab!51898
parents eefb218a b68a6718
...@@ -41,6 +41,9 @@ class TrialsController < ApplicationController ...@@ -41,6 +41,9 @@ class TrialsController < ApplicationController
@result = GitlabSubscriptions::ApplyTrialService.new.execute(apply_trial_params) @result = GitlabSubscriptions::ApplyTrialService.new.execute(apply_trial_params)
if @result&.dig(:success) if @result&.dig(:success)
record_experiment_user(:remove_known_trial_form_fields, namespace_id: @namespace.id)
record_experiment_user(:trimmed_skip_trial_copy, namespace_id: @namespace.id)
record_experiment_user(:trial_registration_with_social_signin, namespace_id: @namespace.id)
record_experiment_conversion_event(:remove_known_trial_form_fields) record_experiment_conversion_event(:remove_known_trial_form_fields)
record_experiment_conversion_event(:trimmed_skip_trial_copy) record_experiment_conversion_event(:trimmed_skip_trial_copy)
record_experiment_conversion_event(:trial_registration_with_social_signin) record_experiment_conversion_event(:trial_registration_with_social_signin)
......
...@@ -226,6 +226,9 @@ RSpec.describe TrialsController do ...@@ -226,6 +226,9 @@ RSpec.describe TrialsController do
it { is_expected.to redirect_to("/#{namespace.path}?trial=true") } it { is_expected.to redirect_to("/#{namespace.path}?trial=true") }
it 'calls the record conversion method for the experiments' do it 'calls the record conversion method for the experiments' do
expect(controller).to receive(:record_experiment_user).with(:remove_known_trial_form_fields, namespace_id: namespace.id)
expect(controller).to receive(:record_experiment_user).with(:trimmed_skip_trial_copy, namespace_id: namespace.id)
expect(controller).to receive(:record_experiment_user).with(:trial_registration_with_social_signin, namespace_id: namespace.id)
expect(controller).to receive(:record_experiment_conversion_event).with(:remove_known_trial_form_fields) expect(controller).to receive(:record_experiment_conversion_event).with(:remove_known_trial_form_fields)
expect(controller).to receive(:record_experiment_conversion_event).with(:trimmed_skip_trial_copy) expect(controller).to receive(:record_experiment_conversion_event).with(:trimmed_skip_trial_copy)
expect(controller).to receive(:record_experiment_conversion_event).with(:trial_registration_with_social_signin) expect(controller).to receive(:record_experiment_conversion_event).with(:trial_registration_with_social_signin)
......
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