Fix problem with product shipping category factory

This commit is contained in:
Luis Ramos
2020-08-23 14:12:36 +01:00
parent aa00756f9c
commit 6d05de742e

View File

@@ -18,7 +18,7 @@ FactoryBot.define do
variant_unit_scale 1
variant_unit_name ''
shipping_category { |r| Spree::ShippingCategory.first || r.association(:shipping_category) }
shipping_category { DefaultShippingCategory.find_or_create }
# ensure stock item will be created for this products master
before(:create) { create(:stock_location) if Spree::StockLocation.count == 0 }