diff --git a/app/constraints/feature_toggle_constraint.rb b/app/constraints/feature_toggle_constraint.rb index 1393b007fe..cae850574d 100644 --- a/app/constraints/feature_toggle_constraint.rb +++ b/app/constraints/feature_toggle_constraint.rb @@ -12,6 +12,6 @@ class FeatureToggleConstraint end def current_user(request) - request.env['warden'].user + request.env['warden']&.user end end diff --git a/spec/routing/stripe_spec.rb b/spec/routing/stripe_spec.rb index 54dd76bde2..9ce5ce8c6c 100644 --- a/spec/routing/stripe_spec.rb +++ b/spec/routing/stripe_spec.rb @@ -3,10 +3,6 @@ require "spec_helper" describe "routing for Stripe return URLS", type: :routing do - before do - allow_any_instance_of(FeatureToggleConstraint).to receive(:current_user) { build(:user) } - end - context "checkout return URLs" do it "routes /checkout to checkout#edit" do expect(get: "checkout").