Commit 75db5147 authored by Sean McGivern's avatar Sean McGivern

Merge branch 'fix-paid-signup-flow-recognition' into 'master'

Fix URL params breaking flow recognition

See merge request gitlab-org/gitlab!24869
parents 295f65c8 086542e2
...@@ -3,7 +3,9 @@ ...@@ -3,7 +3,9 @@
module EE module EE
module RegistrationsHelper module RegistrationsHelper
def in_paid_signup_flow? def in_paid_signup_flow?
experiment_enabled?(:paid_signup_flow) && session['user_return_to'] == new_subscriptions_path experiment_enabled?(:paid_signup_flow) &&
(redirect_to = session['user_return_to']) &&
URI.parse(redirect_to).path == new_subscriptions_path
end end
end end
end end
...@@ -7,10 +7,12 @@ describe EE::RegistrationsHelper do ...@@ -7,10 +7,12 @@ describe EE::RegistrationsHelper do
describe '#in_paid_signup_flow?' do describe '#in_paid_signup_flow?' do
where(:user_return_to_path, :paid_signup_flow_enabled, :expected_result) do where(:user_return_to_path, :paid_signup_flow_enabled, :expected_result) do
'/-/subscriptions/new' | true | true '/-/subscriptions/new?plan_id=bronze_plan' | true | true
'/-/subscriptions/new' | false | false '/-/subscriptions/new?plan_id=bronze_plan' | false | false
'/' | true | false '/foo' | true | false
'/' | false | false '/foo' | false | false
nil | true | nil
nil | false | false
end end
with_them do with_them 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