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.
Ruby b2b-commercee-commerceecommerceecommerce-apiecommerce-frameworkecommerce-platformheadlessheadless-commerceheadless-ecommercemarketplacemulti-tenantmulti-vendormulti-vendor-ecommerceopen-sourcespree-commerce
Modify Icon factory to support not having attachment (#11634)
Aleksandar Petrushev12d551bbdd99
diff --git a/core/lib/spree/testing_support/factories/icon_factory.rb b/core/lib/spree/testing_support/factories/icon_factory.rbindex 049043ff47..6db61604d6 100644--- a/core/lib/spree/testing_support/factories/icon_factory.rb+++ b/core/lib/spree/testing_support/factories/icon_factory.rb@@ -1,7 +1,9 @@FactoryBot.define dofactory :icon, class: Spree::Icon dobefore(:create) do |icon|- icon.attachment.attach(io: File.new(Spree::Core::Engine.root + 'spec/fixtures' + 'thinking-cat.jpg'), filename: 'thinking-cat.jpg')+ if icon.respond_to? :attachment+ icon.attachment.attach(io: File.new(Spree::Core::Engine.root + 'spec/fixtures' + 'thinking-cat.jpg'), filename: 'thinking-cat.jpg')+ endendendend