Skip to content

Commit

Permalink
Add last_incomplete_spree_order to test doubles in checkout and produ…
Browse files Browse the repository at this point in the history
…cts controller specs
  • Loading branch information
radar committed May 31, 2012
1 parent fd288d3 commit 04d38ff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions core/spec/controllers/spree/checkout_controller_spec.rb
Expand Up @@ -40,14 +40,14 @@
end end


it "should associate the order with a user" do it "should associate the order with a user" do
user = double("User") user = double("User", :last_incomplete_spree_order => nil)
controller.stub(:spree_current_user => user) controller.stub(:spree_current_user => user)
order.should_receive(:associate_user!).with(user) order.should_receive(:associate_user!).with(user)
spree_get :edit, {}, :order_id => 1 spree_get :edit, {}, :order_id => 1
end end


it "should fire the spree.user.signup event if user has just signed up" do it "should fire the spree.user.signup event if user has just signed up" do
user = double("User") user = double("User", :last_incomplete_spree_order => nil)
controller.stub(:spree_current_user => user) controller.stub(:spree_current_user => user)
controller.should_receive(:fire_event).with("spree.user.signup", :user => user, :order => order) controller.should_receive(:fire_event).with("spree.user.signup", :user => user, :order => order)
spree_get :edit, {}, :spree_user_signup => true spree_get :edit, {}, :spree_user_signup => true
Expand Down
2 changes: 1 addition & 1 deletion core/spec/controllers/spree/products_controller_spec.rb
Expand Up @@ -5,7 +5,7 @@


# Regression test for #1390 # Regression test for #1390
it "allows admins to view non-active products" do it "allows admins to view non-active products" do
controller.stub :spree_current_user => stub(:has_spree_role? => true) controller.stub :spree_current_user => stub(:has_spree_role? => true, :last_incomplete_spree_order => nil)
get :show, :id => product.to_param get :show, :id => product.to_param
response.status.should == 200 response.status.should == 200
end end
Expand Down

0 comments on commit 04d38ff

Please sign in to comment.