Skip to content

Commit

Permalink
Add test for persisting taxon on variant during product creation
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt-Yorkley authored and rioug committed Feb 20, 2024
1 parent e91c2d8 commit afca35c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion spec/models/spree/product_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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

Expand Down

0 comments on commit afca35c

Please sign in to comment.