Fix upload test with non allowed content-type
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
c105e9894c
commit
ff51c5bd1e
|
@ -119,7 +119,7 @@ defmodule Mobilizon.UploadTest do
|
||||||
assert data.name == "an [image.jpg"
|
assert data.name == "an [image.jpg"
|
||||||
end
|
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.cp("test/fixtures/test.txt", "test/fixtures/test_tmp.txt")
|
||||||
|
|
||||||
file = %Plug.Upload{
|
file = %Plug.Upload{
|
||||||
|
@ -128,8 +128,7 @@ defmodule Mobilizon.UploadTest do
|
||||||
filename: "test.txt"
|
filename: "test.txt"
|
||||||
}
|
}
|
||||||
|
|
||||||
{:ok, data} = Upload.store(file)
|
assert {:error, :mime_type_not_allowed} == Upload.store(file)
|
||||||
assert data.name == "test.txt"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
test "copies the file to the configured folder with anonymizing filename" do
|
test "copies the file to the configured folder with anonymizing filename" do
|
||||||
|
|
Loading…
Reference in a new issue