Commit 1182bf4e authored by Alper Akgun's avatar Alper Akgun

Redirect trial query parameters

parent a5f3d391
...@@ -17,10 +17,12 @@ class TrialRegistrationsController < RegistrationsController ...@@ -17,10 +17,12 @@ class TrialRegistrationsController < RegistrationsController
private private
def set_redirect_url def set_redirect_url
target_url = new_trial_url(params: request.query_parameters)
if user_signed_in? if user_signed_in?
redirect_to new_trial_url redirect_to target_url
else else
store_location_for(:user, new_trial_url) store_location_for(:user, target_url)
end end
end end
......
...@@ -20,6 +20,14 @@ describe TrialRegistrationsController do ...@@ -20,6 +20,14 @@ describe TrialRegistrationsController do
expect(response).to redirect_to(new_trial_url) expect(response).to redirect_to(new_trial_url)
end 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 end
context 'when customer is not authenticated' do 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