Showcase the problem with some specs

They're always passing because an error (different from `StripeError`),
is actually making them pass.
This commit is contained in:
David Rodríguez
2025-10-21 03:57:47 +02:00
parent 7415503b63
commit 2bd536298b

View File

@@ -52,7 +52,10 @@ RSpec.describe Stripe::PaymentIntentValidator do
it "returns payment intent id and does not raise" do
expect {
result = validator.call
expect(result).to eq payment_intent_response_body
expect(result).to eq(
"this doesn't affect the spec because it never runs, due to a previous error." \
"Yet, since this is wrapper in a negative raise_error block, it still passes"
)
}.not_to raise_error Stripe::StripeError
end
@@ -196,7 +199,10 @@ RSpec.describe Stripe::PaymentIntentValidator do
it "returns payment intent id and does not raise" do
expect {
result = validator.call
expect(result).to eq payment_intent_response_body
expect(result).to eq(
"this doesn't affect the spec because it never runs, due to a previous error." \
"Yet, since this is wrapper in a negative raise_error block, it still passes"
)
}.not_to raise_error Stripe::StripeError
end