From fbda3c15ff448c7751162c3c772145c1fc316dcb Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Sat, 10 Apr 2021 15:38:21 +0100 Subject: [PATCH] Fix deprecated use of #stub in payment spec Fixes: Using `stub` from rspec-mocks' old `:should` syntax without explicitly enabling the syntax is deprecated. Use the new `:expect` syntax or explicitly enable `:should` instead. Called from /home/runner/work/openfoodnetwork/openfoodnetwork/spec/models/spree/payment_spec.rb:10:in `block (3 levels) in '. RuntimeError: stubbed models are not allowed to access the database - Spree::Product#touch(updated_at,{:time=>2021-04-10 14:24:50 UTC}) --- 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 1b084adc2a..2f6554a607 100644 --- a/spec/models/spree/payment_spec.rb +++ b/spec/models/spree/payment_spec.rb @@ -7,7 +7,7 @@ describe Spree::Payment do let(:order) { create(:order) } let(:gateway) do gateway = Spree::Gateway::Bogus.new(environment: 'test', active: true) - gateway.stub source_required: true + allow(gateway).to receive(:source_required) { true } gateway end