Commit 4d1d5a4b authored by Doug Stull's avatar Doug Stull

Merge branch 'jswain_combined_registration_auto_trial_params' into 'master'

Provide namespace_id default value

See merge request gitlab-org/gitlab!70823

After !70196 was
merged, and testing on staging we noticed that the namespace_id
parameter was missing. This MR is a bugfix, to provide the
namespace_id parameter when it's not provided.

part of:
#339654

Changelog: fixed
EE: true
parents 9b06c6ca 45dfc11d
......@@ -35,6 +35,7 @@ class TrialsController < ApplicationController
if params[:glm_source] == 'about.gitlab.com'
redirect_to(new_users_sign_up_group_path(url_params.merge(trial_onboarding_flow: true)))
elsif @namespace = helpers.only_trialable_group_namespace
params[:namespace_id] = @namespace.id
apply_trial_and_redirect
else
redirect_to select_trials_url(url_params)
......
......@@ -127,10 +127,9 @@ RSpec.describe TrialsController do
context 'when the ApplyTrialService is successful' do
it 'applies a trial to the namespace' do
gl_com_params = { gitlab_com_trial: true, sync_to_gl: true }
apply_trial_params = {
uid: user.id,
trial_user: ActionController::Parameters.new(post_params).permit(:namespace_id).merge(gl_com_params)
trial_user: ActionController::Parameters.new(post_params).permit(:namespace_id).merge(namespace_id: namespace.id, gitlab_com_trial: true, sync_to_gl: true)
}
expect_next_instance_of(GitlabSubscriptions::ApplyTrialService) do |service|
......
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