diff --git a/spec/models/spree/payment_spec.rb b/spec/models/spree/payment_spec.rb index c190d701d02..8c41f1963fe 100644 --- a/spec/models/spree/payment_spec.rb +++ b/spec/models/spree/payment_spec.rb @@ -387,13 +387,13 @@ context "when response is successful" do it "should create an offsetting payment" do - Spree::Payment.should_receive(:create!) + expect(Spree::Payment).to receive(:create!) payment.credit! end it "resulting payment should have correct values" do - payment.order.stub :outstanding_balance => 100 - payment.stub :credit_allowed => 10 + allow(payment.order).to receive(:outstanding_balance) { 100 } + allow(payment).to receive(:credit_allowed) { 10 } offsetting_payment = payment.credit! expect(offsetting_payment.amount.to_f).to eq(-10)