diff --git a/spec/models/spree/product_spec.rb b/spec/models/spree/product_spec.rb index e04ef54528..0c3ebee9dc 100644 --- a/spec/models/spree/product_spec.rb +++ b/spec/models/spree/product_spec.rb @@ -194,24 +194,6 @@ module Spree expect(build(:simple_product, supplier: nil)).not_to be_valid end - describe "tax category" do - context "when a tax category is required" do - it "is invalid when a tax category is not provided" do - with_products_require_tax_category(true) do - expect(build(:product, tax_category_id: nil)).not_to be_valid - end - end - end - - context "when a tax category is not required" do - it "is valid when a tax category is not provided" do - with_products_require_tax_category(false) do - expect(build(:product, tax_category_id: nil)).to be_valid - end - end - end - end - context "when the product has variants" do let(:product) do product = create(:simple_product) diff --git a/spec/models/spree/variant_spec.rb b/spec/models/spree/variant_spec.rb index d1701b24f7..93a0e603da 100644 --- a/spec/models/spree/variant_spec.rb +++ b/spec/models/spree/variant_spec.rb @@ -22,6 +22,24 @@ describe Spree::Variant do variant.unit_value = 0 expect(variant).to be_invalid end + + describe "tax category" do + context "when a tax category is required" do + it "is invalid when a tax category is not provided" do + with_products_require_tax_category(true) do + expect(build_stubbed(:variant, tax_category_id: nil)).not_to be_valid + end + end + end + + context "when a tax category is not required" do + it "is valid when a tax category is not provided" do + with_products_require_tax_category(false) do + expect(build_stubbed(:variant, tax_category_id: nil)).to be_valid + end + end + end + end end context "price parsing" do