From 7bf31d120b650c8dfed06f4492076029c40d06b0 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Wed, 3 Feb 2021 16:44:05 +0000 Subject: [PATCH] Add price field test --- spec/models/spree/price_spec.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/spec/models/spree/price_spec.rb b/spec/models/spree/price_spec.rb index bde8fc2cbe..ec7b1e161f 100644 --- a/spec/models/spree/price_spec.rb +++ b/spec/models/spree/price_spec.rb @@ -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