From 1e05e6285602656bc3504b83d03135c343cd50e6 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sat, 1 Jul 2017 14:24:43 +0200 Subject: [PATCH] Test basic upload --- test/disk_site_test.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/disk_site_test.rb b/test/disk_site_test.rb index 7713189e0a..afae5d4683 100644 --- a/test/disk_site_test.rb +++ b/test/disk_site_test.rb @@ -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