aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage/test/service/s3_service_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activestorage/test/service/s3_service_test.rb')
-rw-r--r--activestorage/test/service/s3_service_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/activestorage/test/service/s3_service_test.rb b/activestorage/test/service/s3_service_test.rb
index 4bfcda017f..559aa028f2 100644
--- a/activestorage/test/service/s3_service_test.rb
+++ b/activestorage/test/service/s3_service_test.rb
@@ -31,6 +31,13 @@ if SERVICE_CONFIGURATIONS[:s3]
end
end
+ test "upload a zero byte file" do
+ blob = directly_upload_file_blob filename: "empty_file.txt", content_type: nil
+ user = User.create! name: "DHH", avatar: blob
+
+ assert_equal user.avatar.blob, blob
+ end
+
test "signed URL generation" do
url = @service.url(@key, expires_in: 5.minutes,
disposition: :inline, filename: ActiveStorage::Filename.new("avatar.png"), content_type: "image/png")