Add price field test

This commit is contained in:
Matt-Yorkley
2021-02-03 16:44:05 +00:00
parent 9851c9a762
commit 7bf31d120b

View File

@@ -16,5 +16,13 @@ module Spree
expect(price.reload.variant).to eq variant
end
end
context "with large values" do
let(:expensive_variant) { build(:variant, price: 10_000_000) }
it "throws an error" do
expect{ expensive_variant.save }.to raise_error ActiveRecord::StatementInvalid
end
end
end
end