Permalink
Browse files

Test cases for previous commit.

  • Loading branch information...
1 parent 8f26cf0 commit 9fca760ff7485f95f66547f450e30984eb5861f4 Mauro Botelho committed Nov 16, 2011
Showing with 4 additions and 0 deletions.
  1. +4 −0 core/spec/models/product_spec.rb
@@ -89,6 +89,10 @@
let(:product) { Factory(:product) }
let(:variant) { Factory(:variant, :on_hand => 123)}
it 'uses variant\'s on_hand instead of product' do
+ Spree::Config.set :track_inventory_levels => true
+ product.master.update_attribute(:on_hand, 0)
+ variant = Factory(:variant, :product => product, :on_hand => 100, :is_master => false, :deleted_at => nil)
+ product.save!
Product.on_hand.find(variant.product.id).should eql variant.product
end
end

0 comments on commit 9fca760

Please sign in to comment.