Adjust factory

This commit is contained in:
Matt-Yorkley
2023-08-08 13:03:00 +01:00
committed by Gaetan Craig-Riou
parent d9899e8af6
commit d281e9d1b5

View File

@@ -12,7 +12,7 @@ FactoryBot.define do
depth { generate(:random_float) }
primary_taxon { Spree::Taxon.first || FactoryBot.create(:taxon) }
product { |v| create(:product, primary_taxon_id: v.primary_taxon.id) }
product { |p| p.association(:product) }
# ensure stock item will be created for this variant
before(:create) { create(:stock_location) if Spree::StockLocation.count.zero? }
@@ -23,7 +23,6 @@ FactoryBot.define do
on_hand { 5 }
end
product { |v| create(:product, primary_taxon_id: v.primary_taxon.id) }
unit_value { 1 }
unit_description { '' }