Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Add factory for product translations

Rafal Cymerys84d418a3ddba
diff --git a/core/lib/spree/testing_support/factories/product_translation_factory.rb b/core/lib/spree/testing_support/factories/product_translation_factory.rb
new file mode 100644
index 0000000000..dfd270e5a4
--- /dev/null
+++ b/core/lib/spree/testing_support/factories/product_translation_factory.rb
@@ -0,0 +1,6 @@
+FactoryBot.define do
+ factory :product_translation, class: Spree::Product::Translation do
+ sequence(:name) { |n| "Product #{n}" }
+ description { generate(:random_description) }
+ end
+end