From 9c402fbdb23da227ca25b79386440e0e3b2b573a Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Thu, 2 May 2024 17:00:48 +1000 Subject: [PATCH] Verify partial doubles And look, we were stubbing deleted code. --- spec/base_spec_helper.rb | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/spec/base_spec_helper.rb b/spec/base_spec_helper.rb index aabd97dbdf..9d54095759 100644 --- a/spec/base_spec_helper.rb +++ b/spec/base_spec_helper.rb @@ -105,6 +105,15 @@ RSpec.configure do |config| expectations.include_chain_clauses_in_custom_matcher_descriptions = true end + # rspec-mocks config goes here. You can use an alternate test double + # library (such as bogus or mocha) by changing the `mock_with` option here. + config.mock_with :rspec do |mocks| + # Prevents you from mocking or stubbing a method that does not exist on + # a real object. This is generally recommended, and will default to + # `true` in RSpec 4. + mocks.verify_partial_doubles = true + end + # Reset locale for all specs. config.around(:each) do |example| I18n.with_locale(:en) { example.run } @@ -191,11 +200,6 @@ RSpec.configure do |config| end end - # Geocoding - config.before(:each) { - allow_any_instance_of(Spree::Address).to receive(:geocode).and_return([1, 1]) - } - default_country_id = DefaultCountry.id checkout_zone = Spree::Config[:checkout_zone] currency = Spree::Config[:currency]