diff --git a/activestorage/test/controllers/direct_uploads_controller_test.rb b/activestorage/test/controllers/direct_uploads_controller_test.rb index 17356c0590..8186b33f48 100644 --- a/activestorage/test/controllers/direct_uploads_controller_test.rb +++ b/activestorage/test/controllers/direct_uploads_controller_test.rb @@ -6,12 +6,14 @@ require "database/setup" if SERVICE_CONFIGURATIONS[:s3] && SERVICE_CONFIGURATIONS[:s3][:access_key_id].present? class ActiveStorage::S3DirectUploadsControllerTest < ActionDispatch::IntegrationTest setup do + Rails.configuration.active_storage.service = "s3" @old_service = ActiveStorage::Blob.service ActiveStorage::Blob.service = ActiveStorage::Service.configure(:s3, SERVICE_CONFIGURATIONS) end teardown do ActiveStorage::Blob.service = @old_service + Rails.configuration.active_storage.service = "local" end test "creating new direct upload" do diff --git a/activestorage/test/test_helper.rb b/activestorage/test/test_helper.rb index bfe7d16e93..40e91c6a1a 100644 --- a/activestorage/test/test_helper.rb +++ b/activestorage/test/test_helper.rb @@ -35,13 +35,13 @@ end require "tmpdir" -Rails.configuration.active_storage.service_configurations = { +Rails.configuration.active_storage.service_configurations = SERVICE_CONFIGURATIONS.deep_stringify_keys.merge( "local" => { "service" => "Disk", "root" => Dir.mktmpdir("active_storage_tests") }, "disk_mirror_1" => { "service" => "Disk", "root" => Dir.mktmpdir("active_storage_tests_1") }, "disk_mirror_2" => { "service" => "Disk", "root" => Dir.mktmpdir("active_storage_tests_2") }, "disk_mirror_3" => { "service" => "Disk", "root" => Dir.mktmpdir("active_storage_tests_3") }, "mirror" => { "service" => "Mirror", "primary" => "local", "mirrors" => ["disk_mirror_1", "disk_mirror_2", "disk_mirror_3"] } -} +) Rails.configuration.active_storage.service = "local"