1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Test basic upload

This commit is contained in:
David Heinemeier Hansson 2017-07-01 14:24:43 +02:00
parent 8e4e9741a8
commit 1e05e62856

View file

@ -19,6 +19,14 @@ class ActiveFile::DiskSiteTest < ActiveSupport::TestCase
FIXTURE_FILE.rewind
end
test "uploading" do
key = SecureRandom.base58(24)
data = "Something else entirely!"
@site.upload(key, StringIO.new(data))
assert_equal data, @site.download(key)
end
test "downloading" do
assert_equal FIXTURE_FILE.read, @site.download(FIXTURE_KEY)
end