diff options
author | George Claghorn <george@basecamp.com> | 2017-07-24 23:50:20 -0400 |
---|---|---|
committer | George Claghorn <george@basecamp.com> | 2017-07-24 23:50:20 -0400 |
commit | 1907f465bc7a3385fa53fb2a2466372f96990615 (patch) | |
tree | 721ddcc9cbf32e0225e016c6af54b6322485f3aa | |
parent | 6dd82b84de08635d3178fa3916e153d78f03c6e1 (diff) | |
download | rails-1907f465bc7a3385fa53fb2a2466372f96990615.tar.gz rails-1907f465bc7a3385fa53fb2a2466372f96990615.tar.bz2 rails-1907f465bc7a3385fa53fb2a2466372f96990615.zip |
Deep merge
-rw-r--r-- | test/service/s3_service_test.rb | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/test/service/s3_service_test.rb b/test/service/s3_service_test.rb index 019652e28f..fa2df263a6 100644 --- a/test/service/s3_service_test.rb +++ b/test/service/s3_service_test.rb @@ -33,20 +33,17 @@ if SERVICE_CONFIGURATIONS[:s3] end test "uploading with server-side encryption" do - config = {} - config[:s3] = SERVICE_CONFIGURATIONS[:s3].merge \ - upload: { server_side_encryption: "AES256" } - - sse_service = ActiveStorage::Service.configure(:s3, config) + config = SERVICE_CONFIGURATIONS.deep_merge(s3: { upload: { server_side_encryption: "AES256" }}) + service = ActiveStorage::Service.configure(:s3, config) begin key = SecureRandom.base58(24) data = "Something else entirely!" - sse_service.upload(key, StringIO.new(data), checksum: Digest::MD5.base64digest(data)) + service.upload key, StringIO.new(data), checksum: Digest::MD5.base64digest(data) - assert_equal "AES256", sse_service.bucket.object(key).server_side_encryption + assert_equal "AES256", service.bucket.object(key).server_side_encryption ensure - sse_service.delete key + service.delete key end end end |