Commit 086542e2 authored by Alex Buijs's avatar Alex Buijs

Fix URL params breaking flow recognition

parent fcc2bdb4
......@@ -3,7 +3,9 @@
module EE
module RegistrationsHelper
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
......@@ -7,10 +7,12 @@ describe EE::RegistrationsHelper do
describe '#in_paid_signup_flow?' do
where(:user_return_to_path, :paid_signup_flow_enabled, :expected_result) do
'/-/subscriptions/new' | true | true
'/-/subscriptions/new' | false | false
'/' | true | false
'/' | false | false
'/-/subscriptions/new?plan_id=bronze_plan' | true | true
'/-/subscriptions/new?plan_id=bronze_plan' | false | false
'/foo' | true | false
'/foo' | false | false
nil | true | nil
nil | false | false
end
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