diff options
author | Yannick Schutz <yschutz@salesforce.com> | 2018-11-30 15:54:38 +0100 |
---|---|---|
committer | Yannick Schutz <yschutz@salesforce.com> | 2018-11-30 15:54:38 +0100 |
commit | 7bd21e8575d4d1f5a6315898657b49574de9eb36 (patch) | |
tree | 9f7f0dff0a9defb60ead880532c5081facdcba0d /activestorage/test | |
parent | 5c6316dbb88075e27169f49a22e59357efd1a967 (diff) | |
download | rails-7bd21e8575d4d1f5a6315898657b49574de9eb36.tar.gz rails-7bd21e8575d4d1f5a6315898657b49574de9eb36.tar.bz2 rails-7bd21e8575d4d1f5a6315898657b49574de9eb36.zip |
Add a test with extra keys to active_storage Service#upload
Diffstat (limited to 'activestorage/test')
-rw-r--r-- | activestorage/test/service/shared_service_tests.rb | 19 |
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 |