Replace .stub with expect(x).to receive(:y)

The #stub method is slightly deprecated syntax. Using #expect has the additional benefit here of failing if the object does not receive the expected method call.
This commit is contained in:
Matt-Yorkley
2022-02-15 12:19:15 +00:00
parent 8084ad0068
commit 5be1b139b9

View File

@@ -407,8 +407,8 @@ describe Spree::Payment do
context "if payment method has any payment fees" do
before do
payment.order.stub outstanding_balance: 10
payment.stub credit_allowed: 200
expect(payment.order).to receive(:outstanding_balance).at_least(:once) { 10 }
expect(payment).to receive(:credit_allowed) { 200 }
end
it "should not applied any transaction fees" do