diff --git a/spec/factories/product_factory.rb b/spec/factories/product_factory.rb index 4c36f71fc1..f13cad00ba 100644 --- a/spec/factories/product_factory.rb +++ b/spec/factories/product_factory.rb @@ -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 }