Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Pending Request Spec: Api Admin update payment state expectations. #4149

Merged
merged 1 commit into from
Sep 8, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions api/spec/requests/spree/api/payments_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ module Spree
put spree.api_order_payment_path(order, payment), params: { payment: { amount: 'invalid' } }
expect(response.status).to eq(422)
expect(json_response["error"]).to eq("Invalid resource. Please fix errors and try again.")
expect(payment.reload.state).to eq("pending")
end

it "returns a 403 status when the payment is not pending" do
Expand Down Expand Up @@ -186,10 +187,6 @@ module Spree
expect(response.status).to eq(422)
expect(json_response["error"]).to eq "Invalid resource. Please fix errors and try again."
expect(json_response["errors"]["base"][0]).to eq "Could not authorize card"
end

it "does not raise a stack level error" do
skip "Investigate why a payment.reload after the request raises 'stack level too deep'"
expect(payment.reload.state).to eq("failed")
end
end
Expand All @@ -213,6 +210,7 @@ module Spree
expect(response.status).to eq(422)
expect(json_response["error"]).to eq "Invalid resource. Please fix errors and try again."
expect(json_response["errors"]["base"][0]).to eq "Insufficient funds"
expect(payment.reload.state).to eq("failed")
end
end
end
Expand All @@ -235,6 +233,7 @@ module Spree
expect(response.status).to eq(422)
expect(json_response["error"]).to eq "Invalid resource. Please fix errors and try again."
expect(json_response["errors"]["base"][0]).to eq "Insufficient funds"
expect(payment.reload.state).to eq("failed")
end
end
end
Expand Down