mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user