Skip to content

Commit

Permalink
Merge pull request #4149 from jcowhigjr/jcowhigjr-patch-1
Browse files Browse the repository at this point in the history
Remove Pending Request Spec: Api Admin update payment state expectations.
  • Loading branch information
kennyadsl authored Sep 8, 2021
2 parents ea200df + 778524e commit 0be17af
Showing 1 changed file with 3 additions and 4 deletions.
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

0 comments on commit 0be17af

Please sign in to comment.