Browse Source

Fix current user method for Spree 1.2.x

1-2-stable-sysmocom
Jeff Dutil 9 years ago
parent
commit
56930b93aa
  1. 2
      app/controllers/spree/checkout_controller_decorator.rb
  2. 2
      spec/controllers/checkout_controller_spec.rb

2
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

2
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

Loading…
Cancel
Save