mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-05 02:41:33 +00:00
Adjust factory
This commit is contained in:
committed by
Gaetan Craig-Riou
parent
d9899e8af6
commit
d281e9d1b5
@@ -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 { '' }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user