Skip to content
Browse files

Add last_incomplete_spree_order to test doubles in checkout and produ…

…cts controller specs
  • Loading branch information...
1 parent fd288d3 commit 04d38ffa4acc26d670d2b3d423b733c2e8b5110e @radar radar committed May 31, 2012
View
4 core/spec/controllers/spree/checkout_controller_spec.rb
@@ -40,14 +40,14 @@
end
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)
order.should_receive(:associate_user!).with(user)
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")
+ user = double("User", :last_incomplete_spree_order => nil)
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
View
2 core/spec/controllers/spree/products_controller_spec.rb
@@ -5,7 +5,7 @@
# Regression test for #1390
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
response.status.should == 200
end

0 comments on commit 04d38ff

Please sign in to comment.
Something went wrong with that request. Please try again.