Fix upload test with non allowed content-type

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2020-10-12 11:14:35 +02:00
parent c105e9894c
commit ff51c5bd1e
No known key found for this signature in database
GPG Key ID: A061B9DDE0CA0773
1 changed files with 2 additions and 3 deletions

View File

@ -119,7 +119,7 @@ defmodule Mobilizon.UploadTest do
assert data.name == "an [image.jpg"
end
test "don't modify filename of an unknown type" do
test "doesn't allow uploading with unknown type" do
File.cp("test/fixtures/test.txt", "test/fixtures/test_tmp.txt")
file = %Plug.Upload{
@ -128,8 +128,7 @@ defmodule Mobilizon.UploadTest do
filename: "test.txt"
}
{:ok, data} = Upload.store(file)
assert data.name == "test.txt"
assert {:error, :mime_type_not_allowed} == Upload.store(file)
end
test "copies the file to the configured folder with anonymizing filename" do