[SPECS]Stripe connect controller specs#380
Merged
apoorv-mishra merged 4 commits intodevelopfrom May 16, 2022
Merged
Conversation
Current Code Coverage Percent of this PR:94.61 %Files having coverage below 100%
|
rohitjoshixyz
suggested changes
May 16, 2022
Contributor
rohitjoshixyz
left a comment
There was a problem hiding this comment.
One spec needs changes
Comment on lines
18
to
26
| it "is authorized to refresh stripe connect" do | ||
| allow(Stripe::AccountLink).to receive(:create) | ||
| .and_return(OpenStruct.new({ url: "https://connect.stripe.com/setup/s/something" })) | ||
| allow(Stripe::Account).to receive(:retrieve) | ||
| .and_return(OpenStruct.new({ details_submitted: false })) | ||
| send_request :get, payments_settings_stripe_connect_refresh_path | ||
| expect(response).to have_http_status(:redirect) | ||
| expect(response).not_to redirect_to("https://connect.stripe.com/setup/s/something") | ||
| expect(flash["alert"]).to eq("You are not authorized to perform this action.") |
Contributor
There was a problem hiding this comment.
Check description and assertion, it is not matching
| .and_return(OpenStruct.new({ url: "https://connect.stripe.com/setup/s/something" })) | ||
| allow(Stripe::Account).to receive(:retrieve) | ||
| .and_return(OpenStruct.new({ details_submitted: false })) | ||
| stripe_connected_account.save |
| end | ||
|
|
||
| context "when stripe connected account doesn't exist" do | ||
| it "is authorized to refresh stripe connect" do |
Contributor
There was a problem hiding this comment.
Check spec description, does not refresh stripe connect account or something similar, it should match the assertion, also if the user is an admin why are they unauthorized?
Contributor
Author
There was a problem hiding this comment.
Actually the description needs to be fixed. Refresh doesn't make sense if the account was not created in the first place.
Contributor
Author
There was a problem hiding this comment.
Fixed to make it return 404 now.
vipulnsward
pushed a commit
that referenced
this pull request
Feb 15, 2026
* Add request specs for internal PaymentSettings#index * Add request specs for internal PaymentSettings#connect_stripe * Add request specs for PaymentSettings#refresh_stripe_connect * Fix specs and address review comments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Notion card
NA
Summary
Controller specs for PR-#363
Preview
Type of change
Please delete options that are not relevant.
not work as expected)
How Has This Been Tested?
Checklist: