aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2018-11-30 11:39:12 -0500
committerGitHub <noreply@github.com>2018-11-30 11:39:12 -0500
commitb37f06c814c75fa29f67e237301256d2ec4ec015 (patch)
treea2075274f791b00234d4c60bb8b17cf0904006b5
parentf6e1061c915a92389fee2819d29b13764942c985 (diff)
parent7bd21e8575d4d1f5a6315898657b49574de9eb36 (diff)
downloadrails-b37f06c814c75fa29f67e237301256d2ec4ec015.tar.gz
rails-b37f06c814c75fa29f67e237301256d2ec4ec015.tar.bz2
rails-b37f06c814c75fa29f67e237301256d2ec4ec015.zip
Merge pull request #34576 from ys/test-upload-extra-keys
Add a test with extra keys to active_storage Service#upload
-rw-r--r--activestorage/test/service/shared_service_tests.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/activestorage/test/service/shared_service_tests.rb b/activestorage/test/service/shared_service_tests.rb
index ca2490f2bc..26e72029c8 100644
--- a/activestorage/test/service/shared_service_tests.rb
+++ b/activestorage/test/service/shared_service_tests.rb
@@ -46,6 +46,25 @@ module ActiveStorage::Service::SharedServiceTests
end
end
+ test "uploading with integrity and multiple keys" do
+ begin
+ key = SecureRandom.base58(24)
+ data = "Something else entirely!"
+ @service.upload(
+ key,
+ StringIO.new(data),
+ checksum: Digest::MD5.base64digest(data),
+ filename: "racecar.jpg",
+ content_type: "image/jpg",
+ metadata: { metadata: true }
+ )
+
+ assert_equal data, @service.download(key)
+ ensure
+ @service.delete key
+ end
+ end
+
test "downloading" do
assert_equal FIXTURE_DATA, @service.download(@key)
end