From afca35c475980e4b802f64d1467b3950153c8780 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Tue, 5 Sep 2023 16:47:12 +0100 Subject: [PATCH] Add test for persisting taxon on variant during product creation --- spec/models/spree/product_spec.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spec/models/spree/product_spec.rb b/spec/models/spree/product_spec.rb index 1453ca0c0d6..301d8a88645 100644 --- a/spec/models/spree/product_spec.rb +++ b/spec/models/spree/product_spec.rb @@ -224,10 +224,11 @@ module Spree context "saving a new product" do let!(:product){ Spree::Product.new } let!(:shipping_category){ create(:shipping_category) } + let!(:taxon){ create(:taxon) } before do create(:stock_location) - product.primary_taxon_id = create(:taxon).id + product.primary_taxon_id = taxon.id product.supplier = create(:supplier_enterprise) product.name = "Product1" product.variant_unit = "weight" @@ -243,6 +244,7 @@ module Spree standard_variant = product.variants.reload.first expect(standard_variant.price).to eq 4.27 expect(standard_variant.shipping_category).to eq shipping_category + expect(standard_variant.primary_taxon).to eq taxon end end