aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/fixtures/image.jpgbin0 -> 291666 bytes
-rw-r--r--test/upload_test.exs12
2 files changed, 12 insertions, 0 deletions
diff --git a/test/fixtures/image.jpg b/test/fixtures/image.jpg
new file mode 100644
index 000000000..09834bb5c
--- /dev/null
+++ b/test/fixtures/image.jpg
Binary files differ
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