aboutsummaryrefslogtreecommitdiff
path: root/test/upload_test.exs
diff options
context:
space:
mode:
Diffstat (limited to 'test/upload_test.exs')
-rw-r--r--test/upload_test.exs13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/upload_test.exs b/test/upload_test.exs
index 645f10293..09aa5e068 100644
--- a/test/upload_test.exs
+++ b/test/upload_test.exs
@@ -43,5 +43,18 @@ defmodule Pleroma.UploadTest do
data = Upload.store(file, true)
assert hd(data["url"])["mediaType"] == "image/jpeg"
end
+
+ test "adds missing extension" do
+ File.cp!("test/fixtures/image.jpg", "test/fixtures/image_tmp.jpg")
+
+ file = %Plug.Upload{
+ content_type: "image/jpg",
+ path: Path.absname("test/fixtures/image_tmp.jpg"),
+ filename: "an [image"
+ }
+
+ data = Upload.store(file, false)
+ assert data["name"] == "an [image.jpg"
+ end
end
end