From 2bd536298b13de193bacf10a2e395fa1b22d2fc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= <2887858+deivid-rodriguez@users.noreply.github.com> Date: Tue, 21 Oct 2025 03:57:47 +0200 Subject: [PATCH] Showcase the problem with some specs They're always passing because an error (different from `StripeError`), is actually making them pass. --- spec/lib/stripe/payment_intent_validator_spec.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/spec/lib/stripe/payment_intent_validator_spec.rb b/spec/lib/stripe/payment_intent_validator_spec.rb index c3d917b614..25ba8f6c18 100644 --- a/spec/lib/stripe/payment_intent_validator_spec.rb +++ b/spec/lib/stripe/payment_intent_validator_spec.rb @@ -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