Permalink
Browse files

Fixed issue where :user was not being passed correct value to spree.u…

…ser.signup event
  • Loading branch information...
1 parent 911f410 commit 221a62b1e050039a2a03eb701319afa7dbe344df @radar radar committed May 30, 2012
@@ -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
@@ -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

0 comments on commit 221a62b

Please sign in to comment.