aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage/test
diff options
context:
space:
mode:
Diffstat (limited to 'activestorage/test')
-rw-r--r--activestorage/test/dummy/config/initializers/backtrace_silencers.rb2
-rw-r--r--activestorage/test/fixtures/files/racecar.tifbin33705838 -> 729182 bytes
-rw-r--r--activestorage/test/service/s3_service_test.rb17
3 files changed, 18 insertions, 1 deletions
diff --git a/activestorage/test/dummy/config/initializers/backtrace_silencers.rb b/activestorage/test/dummy/config/initializers/backtrace_silencers.rb
index d0f0d3b5df..8452ef9236 100644
--- a/activestorage/test/dummy/config/initializers/backtrace_silencers.rb
+++ b/activestorage/test/dummy/config/initializers/backtrace_silencers.rb
@@ -2,7 +2,7 @@
# Be sure to restart your server when you modify this file.
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
-# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
+# Rails.backtrace_cleaner.add_silencer { |line| /my_noisy_library/.match?(line) }
# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
# Rails.backtrace_cleaner.remove_silencers!
diff --git a/activestorage/test/fixtures/files/racecar.tif b/activestorage/test/fixtures/files/racecar.tif
index 0a11b22896..97430741e2 100644
--- a/activestorage/test/fixtures/files/racecar.tif
+++ b/activestorage/test/fixtures/files/racecar.tif
Binary files differ
diff --git a/activestorage/test/service/s3_service_test.rb b/activestorage/test/service/s3_service_test.rb
index b9120770e6..3dd1b59681 100644
--- a/activestorage/test/service/s3_service_test.rb
+++ b/activestorage/test/service/s3_service_test.rb
@@ -77,6 +77,23 @@ if SERVICE_CONFIGURATIONS[:s3]
@service.delete key
end
+ test "upload with content disposition" do
+ key = SecureRandom.base58(24)
+ data = "Something else entirely!"
+
+ @service.upload(
+ key,
+ StringIO.new(data),
+ checksum: Digest::MD5.base64digest(data),
+ filename: ActiveStorage::Filename.new("cool_data.txt"),
+ disposition: :attachment
+ )
+
+ assert_equal("attachment; filename=\"cool_data.txt\"; filename*=UTF-8''cool_data.txt", @service.bucket.object(key).content_disposition)
+ ensure
+ @service.delete key
+ end
+
test "uploading a large object in multiple parts" do
service = build_service(upload: { multipart_threshold: 5.megabytes })