mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user