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 <top (required)>'.
     RuntimeError:

       stubbed models are not allowed to access the database - Spree::Product#touch(updated_at,{:time=>2021-04-10 14:24:50 UTC})
This commit is contained in:
Matt-Yorkley
2021-04-10 15:38:21 +01:00
committed by Andy Brett
parent 3bce1bad62
commit fbda3c15ff

View File

@@ -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