mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
add unit test for unit_value
This commit is contained in:
@@ -799,5 +799,13 @@ module Spree
|
||||
expect(variant.unit_value).to eq 1
|
||||
end
|
||||
end
|
||||
|
||||
context "trying to set an invalid unit_value" do
|
||||
it "does not allow NaN" do
|
||||
variant.update(unit_value: Float::NAN)
|
||||
|
||||
expect(variant.reload.unit_value).to eq(1.0)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user