diff --git a/app/controllers/spree/admin/search_controller.rb b/app/controllers/spree/admin/search_controller.rb index 1ddb023b3a..df96618fc0 100644 --- a/app/controllers/spree/admin/search_controller.rb +++ b/app/controllers/spree/admin/search_controller.rb @@ -19,7 +19,12 @@ module Spree def customers @customers = [] - if spree_current_user.enterprises.pluck(:id).include? search_params[:distributor_id].to_i + enterprise_ids = if spree_current_user.admin? + Enterprise.pluck(:id) + else + spree_current_user.enterprises.pluck(:id) + end + if enterprise_ids.include? search_params[:distributor_id].to_i @customers = Customer. ransack(m: 'or', email_start: search_params[:q], first_name_start: search_params[:q], last_name_start: search_params[:q]). diff --git a/spec/system/admin/order_spec.rb b/spec/system/admin/order_spec.rb index c25d5c13c1..ef43bd5b2d 100644 --- a/spec/system/admin/order_spec.rb +++ b/spec/system/admin/order_spec.rb @@ -755,7 +755,6 @@ describe ' end it "finds a customer by name" do - pending("issue #9684") serching_for_customers end end