mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-05 22:26:07 +00:00
Improve StripeAccountsController#connect spec
We are manually testing this while this is already covering the connection of a Stripe account to an OFN instance. This makes it a bit more comprehensive.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user