Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

allow controller to reveive spree_current_user more than once

wjwitek69752d105afa
diff --git a/api/spec/controllers/spree/api/v2/base_controller_spec.rb b/api/spec/controllers/spree/api/v2/base_controller_spec.rb
index 94c1486976..a82e19a8d4 100644
--- a/api/spec/controllers/spree/api/v2/base_controller_spec.rb
+++ b/api/spec/controllers/spree/api/v2/base_controller_spec.rb
@@ -109,7 +109,7 @@ describe Spree::Api::V2::BaseController, type: :controller do
shared_examples 'rescues from error' do
it do
expect(subject).to receive(:index).and_raise(exception)
- expect(subject).to receive(:spree_current_user).and_return(user)
+ expect(subject).to receive(:spree_current_user).at_least(:once).and_return(user)
expect_next_instance_of(::Spree::Api::ErrorHandler) do |instance|
expect(instance).to receive(:call).with(
exception: exception,