Skip to content

Commit

Permalink
Fixed issue where :user was not being passed correct value to spree.u…
Browse files Browse the repository at this point in the history
…ser.signup event
  • Loading branch information
radar committed May 30, 2012
1 parent 911f410 commit 221a62b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion core/app/controllers/spree/checkout_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def associate_user
# Assuming of course that this session variable was set correctly in
# the authentication provider's registrations controller
if session[:spree_user_signup]
fire_event('spree.user.signup', :user => @user, :order => current_order(true))
fire_event('spree.user.signup', :user => spree_current_user, :order => current_order(true))
end

session[:guest_token] = nil
Expand Down
7 changes: 7 additions & 0 deletions core/spec/controllers/spree/checkout_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@
spree_get :edit, {}, :order_id => 1
end

it "should fire the spree.user.signup event if user has just signed up" do
user = double("User")
controller.stub(:spree_current_user => user)
controller.should_receive(:fire_event).with("spree.user.signup", :user => user, :order => order)
spree_get :edit, {}, :spree_user_signup => true
end

end

context "#update" do
Expand Down

0 comments on commit 221a62b

Please sign in to comment.