From 5fba7811c4c829d8bacfa8ba31270aeff8802ad2 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Tue, 15 Feb 2022 12:21:34 +0000 Subject: [PATCH] Remove #try #try is useful when the object might be nil or might not respond to the given method. In this case we expect it to exist and respond to #finalized?, so this is a bit more precise. --- spec/models/spree/payment_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/models/spree/payment_spec.rb b/spec/models/spree/payment_spec.rb index ac5600d9be..5046ba3a2f 100644 --- a/spec/models/spree/payment_spec.rb +++ b/spec/models/spree/payment_spec.rb @@ -413,7 +413,7 @@ describe Spree::Payment do it "should not applied any transaction fees" do payment.credit! - expect(payment.adjustment.try(:finalized?)).to eq(false) + expect(payment.adjustment.finalized?).to eq(false) expect(order.all_adjustments.payment_fee.eligible.length).to eq(0) end end