Commit 7d47ea84 authored by Jan Provaznik's avatar Jan Provaznik

Merge branch '119083-redirect-trial-with-params' into 'master'

Redirects trials with query string parameters

Closes #119083

See merge request gitlab-org/gitlab!23905
parents bc6dda96 1182bf4e
......@@ -17,10 +17,12 @@ class TrialRegistrationsController < RegistrationsController
private
def set_redirect_url
target_url = new_trial_url(params: request.query_parameters)
if user_signed_in?
redirect_to new_trial_url
redirect_to target_url
else
store_location_for(:user, new_trial_url)
store_location_for(:user, target_url)
end
end
......
......@@ -20,6 +20,14 @@ describe TrialRegistrationsController do
expect(response).to redirect_to(new_trial_url)
end
it 'redirect keeps the query string parameters' do
get_params = { glm_source: 'some_source', glm_content: 'some_content' }
get :new, params: get_params
expect(response).to redirect_to(new_trial_url(get_params))
end
end
context 'when customer is not authenticated' do
......
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