Skip to content

Commit

Permalink
Simplified checkout_controller_spec
Browse files Browse the repository at this point in the history
  • Loading branch information
BDQ committed Oct 4, 2011
1 parent 2899eed commit b009713
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions core/spec/controllers/checkout_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -142,19 +142,19 @@

end

context "When last inventory item has been purchased and no backorders" do
context "When last inventory item has been purchased" do
let(:product) { mock_model(Product, :name => "Amazing Object") }
let(:variant) { mock_model(Variant, :on_hand => 0) }
let(:line_item) { mock_model(LineItem, :variant => variant, :quantity => 1, :product => product) }
let(:order) { Factory.new(:order) }
let(:line_item) { mock_model LineItem, :insufficient_stock? => true }
let(:order) { Factory(:order) }

before do
order.stub(:line_items => [line_item])
Spree::Config.set :track_inventory_levels => true
Spree::Config.set :allow_backorders => false
end

context "back orders == false" do
context "and back orders == false" do
before do
post :update, {:state => "payment"}
end
Expand Down

0 comments on commit b009713

Please sign in to comment.