diff --git a/core/lib/spree/testing_support/dummy_app.rb b/core/lib/spree/testing_support/dummy_app.rb index 7fce19d65cd..64c0d4f85d1 100644 --- a/core/lib/spree/testing_support/dummy_app.rb +++ b/core/lib/spree/testing_support/dummy_app.rb @@ -8,6 +8,7 @@ require 'action_controller/railtie' require 'action_mailer/railtie' require 'active_storage/engine' +require 'generators/solidus/paperclip_adapter/install/install_generator' Rails.env = 'test' @@ -41,6 +42,14 @@ def self.setup(gem_root:, lib_name:, auto_migrate: true) if auto_migrate DummyApp::Migrations.auto_migrate end + + if ENV['DISABLE_ACTIVE_STORAGE'] == 'true' + Rails::Generators.invoke('solidus:paperclip_adapter:install', [ + "--set_preferences=false", + "--app_directory=#{DummyApp::Application.config.root}", + "--app_name=DummyApp", + ]) + end end class Application < ::Rails::Application @@ -135,10 +144,8 @@ class Application < ::Rails::Application Spree.load_defaults(Spree.solidus_version) Spree.config do |config| if (ENV['DISABLE_ACTIVE_STORAGE'] == 'true') - Spree::Deprecation.silence do - config.image_attachment_module = 'Spree::Image::PaperclipAttachment' - config.taxon_attachment_module = 'Spree::Taxon::PaperclipAttachment' - end + config.image_attachment_module = 'DummyApp::Image::PaperclipAttachment' + config.taxon_attachment_module = 'DummyApp::Taxon::PaperclipAttachment' end end