From 6d05de742ede72a8e8552163f56cc1c1d37c1c49 Mon Sep 17 00:00:00 2001 From: Luis Ramos Date: Sun, 23 Aug 2020 14:12:36 +0100 Subject: [PATCH] Fix problem with product shipping category factory --- spec/factories/product_factory.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 }