Add Uploads.

This commit is contained in:
Roger Braun 2017-03-29 01:39:01 +02:00
commit 08fdbd6f3a
5 changed files with 48 additions and 0 deletions

BIN
test/fixtures/image.jpg vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 285 KiB

12
test/upload_test.exs Normal file
View file

@ -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