diff options
author | Roger Braun <roger@rogerbraun.net> | 2017-03-29 01:39:01 +0200 |
---|---|---|
committer | Roger Braun <roger@rogerbraun.net> | 2017-03-29 01:39:01 +0200 |
commit | 08fdbd6f3ab15ac8312073d832324516b723b81a (patch) | |
tree | 8546c68833fb842f455968f562a04e1fe6efc2b3 /test | |
parent | d2cdcc097b171461687df1613371c4b04da60186 (diff) | |
download | pleroma-08fdbd6f3ab15ac8312073d832324516b723b81a.tar.gz pleroma-08fdbd6f3ab15ac8312073d832324516b723b81a.zip |
Add Uploads.
Diffstat (limited to 'test')
-rw-r--r-- | test/fixtures/image.jpg | bin | 0 -> 291666 bytes | |||
-rw-r--r-- | test/upload_test.exs | 12 |
2 files changed, 12 insertions, 0 deletions
diff --git a/test/fixtures/image.jpg b/test/fixtures/image.jpg Binary files differnew file mode 100644 index 000000000..09834bb5c --- /dev/null +++ b/test/fixtures/image.jpg diff --git a/test/upload_test.exs b/test/upload_test.exs new file mode 100644 index 000000000..e8c954341 --- /dev/null +++ b/test/upload_test.exs @@ -0,0 +1,12 @@ +defmodule Pleroma.UploadTest do + alias Pleroma.Upload + use Pleroma.DataCase + + describe "Storing a file" do + test "copies the file to the configured folder" do + file = %Plug.Upload{content_type: "image/jpg", path: Path.absname("test/fixtures/image.jpg"), filename: "an_image.jpg"} + data = Upload.store(file) + assert data["name"] == "an_image.jpg" + end + end +end |