From 08fdbd6f3ab15ac8312073d832324516b723b81a Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Wed, 29 Mar 2017 01:39:01 +0200 Subject: Add Uploads. --- test/fixtures/image.jpg | Bin 0 -> 291666 bytes test/upload_test.exs | 12 ++++++++++++ 2 files changed, 12 insertions(+) create mode 100644 test/fixtures/image.jpg create mode 100644 test/upload_test.exs (limited to 'test') diff --git a/test/fixtures/image.jpg b/test/fixtures/image.jpg new file mode 100644 index 000000000..09834bb5c Binary files /dev/null and b/test/fixtures/image.jpg 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 -- cgit v1.2.3