Skip to content

Commit

Permalink
Merge pull request #34576 from ys/test-upload-extra-keys
Browse files Browse the repository at this point in the history
Add a test with extra keys to active_storage Service#upload
  • Loading branch information
rafaelfranca committed Nov 30, 2018
2 parents f6e1061 + 7bd21e8 commit b37f06c
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions activestorage/test/service/shared_service_tests.rb
Expand Up @@ -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
Expand Down

0 comments on commit b37f06c

Please sign in to comment.