From 56930b93aa974fe200cc184da11b91d3670e1785 Mon Sep 17 00:00:00 2001 From: Jeff Dutil Date: Mon, 12 Nov 2012 17:49:27 -0500 Subject: [PATCH] Fix current user method for Spree 1.2.x --- app/controllers/spree/checkout_controller_decorator.rb | 2 +- spec/controllers/checkout_controller_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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