Update outdated spec

This commit is contained in:
Rob Harrington
2014-10-02 17:49:57 +10:00
parent 28486f9e76
commit 971723964e

View File

@@ -28,7 +28,12 @@ module Spree
product = Product.new supplier_id: s.id, name: "Apples", price: 1, primary_taxon_id: t.id, variant_unit: "weight", variant_unit_scale: 1000, unit_value: 1
product.on_hand = "10,000"
expect(product.save).to be_false
expect(product.errors[:count_on_hand]).to include "is not a number"
# It is expected that master variant :count_on_hand should cause the failure to save, and it does. However, this broke with the addition of
# the :ensure_standard_variant callback. Evidently, normal variants are checked and their errors added to the product model before the
# save_master callback on product is run. Therefore, the error that is raised here is one on a normal variant, rather than one on master.
# expect(product.errors[:count_on_hand]).to include "is not a number"
expect(product.errors[:"variants.count_on_hand"]).to include "is not a number"
end
it "defaults available_on to now" do