From ff51c5bd1e639ad80c43bf8a8674e1701000a7b1 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Mon, 12 Oct 2020 11:14:35 +0200 Subject: [PATCH] Fix upload test with non allowed content-type Signed-off-by: Thomas Citharel --- test/web/upload/upload_test.exs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/web/upload/upload_test.exs b/test/web/upload/upload_test.exs index 656d52f8e..0500dd8f4 100644 --- a/test/web/upload/upload_test.exs +++ b/test/web/upload/upload_test.exs @@ -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