mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-03 22:06:07 +00:00
Update outdated spec
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user