diff --git a/spec/controllers/admin/stripe_accounts_controller_spec.rb b/spec/controllers/admin/stripe_accounts_controller_spec.rb index c1b0890316..079ce59f0d 100644 --- a/spec/controllers/admin/stripe_accounts_controller_spec.rb +++ b/spec/controllers/admin/stripe_accounts_controller_spec.rb @@ -13,11 +13,9 @@ describe Admin::StripeAccountsController, type: :controller do end it "redirects to Stripe Authorization url constructed OAuth" do - spree_get :connect - expect(response.location).to match %r(\Ahttps://connect.stripe.com) - uri = URI.parse(response.location) - params = CGI.parse(uri.query) - expect(params.keys).to include 'client_id', 'response_type', 'state', 'scope' + spree_get :connect, enterprise_id: 1 # A deterministic id results in a deterministic state JWT token + + expect(response).to redirect_to("https://connect.stripe.com/oauth/authorize?state=eyJhbGciOiJIUzI1NiJ9.eyJlbnRlcnByaXNlX2lkIjoiMSJ9.jSSFGn0bLhwuiQYK5ORmHWW7aay1l030bcfGwn1JbFg&scope=read_write&client_id=some_id&response_type=code") end end