mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Fix failing tests on Active Storage
This commit is contained in:
parent
84d236d0a9
commit
5d81880670
2 changed files with 4 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
Loading…
Reference in a new issue