Various typespec and compilation improvements

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2021-09-10 11:27:59 +02:00
parent 029a4ea194
commit de047c8939
125 changed files with 790 additions and 357 deletions

View File

@@ -127,7 +127,8 @@ defmodule Mobilizon.UploadTest do
filename: "test.txt"
}
assert {:error, :mime_type_not_allowed} == Upload.store(file)
res = Upload.store(file)
assert match?({:error, :mime_type_not_allowed}, res)
end
test "copies the file to the configured folder with anonymizing filename" do
@@ -189,7 +190,7 @@ defmodule Mobilizon.UploadTest do
refute File.exists?(file)
assert {:error, "File not_existing/definitely.jpg doesn't exist"} =
assert {:error, :enofile} =
Upload.remove("https://mobilizon.test/media/not_existing/definitely.jpg")
end
end