Add Uploads.
This commit is contained in:
parent
d2cdcc097b
commit
08fdbd6f3a
5 changed files with 48 additions and 0 deletions
BIN
test/fixtures/image.jpg
vendored
Normal file
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
12
test/upload_test.exs
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue