aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage/test/service/shared_service_tests.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activestorage/test/service/shared_service_tests.rb')
-rw-r--r--activestorage/test/service/shared_service_tests.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/activestorage/test/service/shared_service_tests.rb b/activestorage/test/service/shared_service_tests.rb
index ca2490f2bc..b97030b320 100644
--- a/activestorage/test/service/shared_service_tests.rb
+++ b/activestorage/test/service/shared_service_tests.rb
@@ -46,6 +46,24 @@ 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"
+ )
+
+ assert_equal data, @service.download(key)
+ ensure
+ @service.delete key
+ end
+ end
+
test "downloading" do
assert_equal FIXTURE_DATA, @service.download(@key)
end