From ce2f0a5b9ec6f90badfd153ada1b6448449f7aab Mon Sep 17 00:00:00 2001 From: Luis Ramos Date: Thu, 6 Aug 2020 12:52:30 +0100 Subject: [PATCH] Transpec specs --- spec/models/spree/preferences/preferable_spec.rb | 4 ++-- spec/models/spree/preferences/store_spec.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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