diff --git a/app/controllers/spree/checkout_controller_decorator.rb b/app/controllers/spree/checkout_controller_decorator.rb index c07f2a0..1c6bde4 100644 --- a/app/controllers/spree/checkout_controller_decorator.rb +++ b/app/controllers/spree/checkout_controller_decorator.rb @@ -337,7 +337,7 @@ module Spree end # suggest current user's email or any email stored in the order - opts[:email] = current_user ? current_user.email : order.email + opts[:email] = spree_current_user ? spree_current_user.email : order.email opts end diff --git a/spec/controllers/checkout_controller_spec.rb b/spec/controllers/checkout_controller_spec.rb index ab0cae6..e177044 100644 --- a/spec/controllers/checkout_controller_spec.rb +++ b/spec/controllers/checkout_controller_spec.rb @@ -22,7 +22,7 @@ module Spree before do Spree::Auth::Config.set(:registration_step => false) - controller.stub(:current_order => order, :check_authorization => true, :current_user => order.user) + controller.stub(:current_order => order, :check_authorization => true, :spree_current_user => order.user) order.stub(:checkout_allowed? => true, :completed? => false) order.update! end