diff options
author | Marcelo Perini Veloso <marcelo.perini.veloso@gmail.com> | 2018-09-05 00:21:44 -0300 |
---|---|---|
committer | Marcelo Perini Veloso <marcelo.perini.veloso@gmail.com> | 2018-09-06 20:04:21 -0300 |
commit | 0d4ba40688785ad65da1af36b3ad8efd8e14505e (patch) | |
tree | 01cad8807fa1c5534fe0b0f4297c182cdd9d2535 /activestorage/test/service | |
parent | 5bd4a4c78b43f25245d3597876f541d84782ecc7 (diff) | |
download | rails-0d4ba40688785ad65da1af36b3ad8efd8e14505e.tar.gz rails-0d4ba40688785ad65da1af36b3ad8efd8e14505e.tar.bz2 rails-0d4ba40688785ad65da1af36b3ad8efd8e14505e.zip |
Fix zero-byte files upload
Diffstat (limited to 'activestorage/test/service')
-rw-r--r-- | activestorage/test/service/s3_service_test.rb | 7 |
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") |