aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage/test
diff options
context:
space:
mode:
authorWillian Gustavo Veiga <beberveiga@gmail.com>2018-10-11 07:44:27 -0300
committerWillian Gustavo Veiga <beberveiga@gmail.com>2018-10-11 07:44:27 -0300
commit99bd626885b72acd44861727918ee107a649e2b4 (patch)
tree6d59fcdb226a65d9eb63f8bad2b2df7b09b92a60 /activestorage/test
parent4b60e34f58c0dabe18a793038fc7775d044016f6 (diff)
parent6a278c6e9a05b0d901e482458cfc2e3df587d522 (diff)
downloadrails-99bd626885b72acd44861727918ee107a649e2b4.tar.gz
rails-99bd626885b72acd44861727918ee107a649e2b4.tar.bz2
rails-99bd626885b72acd44861727918ee107a649e2b4.zip
Merge branch 'master' into feature/reselect-method
Diffstat (limited to 'activestorage/test')
-rw-r--r--activestorage/test/controllers/disk_controller_test.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/activestorage/test/controllers/disk_controller_test.rb b/activestorage/test/controllers/disk_controller_test.rb
index 4bc61d13f3..7b5e989699 100644
--- a/activestorage/test/controllers/disk_controller_test.rb
+++ b/activestorage/test/controllers/disk_controller_test.rb
@@ -67,6 +67,16 @@ class ActiveStorage::DiskControllerTest < ActionDispatch::IntegrationTest
assert_not blob.service.exist?(blob.key)
end
+ test "directly uploading blob with different but equivalent content type" do
+ data = "Something else entirely!"
+ blob = create_blob_before_direct_upload(
+ byte_size: data.size, checksum: Digest::MD5.base64digest(data), content_type: "application/x-gzip")
+
+ put blob.service_url_for_direct_upload, params: data, headers: { "Content-Type" => "application/x-gzip" }
+ assert_response :no_content
+ assert_equal data, blob.download
+ end
+
test "directly uploading blob with mismatched content length" do
data = "Something else entirely!"
blob = create_blob_before_direct_upload byte_size: data.size - 1, checksum: Digest::MD5.base64digest(data)