diff --git a/spec/models/spree/preferences/preferable_spec.rb b/spec/models/spree/preferences/preferable_spec.rb index 3e72812b39..3e156fce1f 100644 --- a/spec/models/spree/preferences/preferable_spec.rb +++ b/spec/models/spree/preferences/preferable_spec.rb @@ -22,9 +22,9 @@ describe Spree::Preferences::Preferable do before :each do @a = A.new - @a.stub(persisted?: true) + allow(@a).to receive_messages(persisted?: true) @b = B.new - @b.stub(persisted?: true) + allow(@b).to receive_messages(persisted?: true) # ensure we're persisting as that is the default # diff --git a/spec/models/spree/preferences/store_spec.rb b/spec/models/spree/preferences/store_spec.rb index 49c72b9274..7d5995e97a 100644 --- a/spec/models/spree/preferences/store_spec.rb +++ b/spec/models/spree/preferences/store_spec.rb @@ -37,7 +37,7 @@ describe Spree::Preferences::Store do it "should return and cache fallback value when persistence is disabled (i.e. on bootstrap)" do Rails.cache.clear - @store.stub(should_persist?: false) + allow(@store).to receive_messages(should_persist?: false) expect(@store.get(:test, true)).to be_truthy expect(Rails.cache.read(:test)).to be_truthy end