X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=test%2Fpleroma%2Fupload_test.exs;fp=test%2Fpleroma%2Fupload_test.exs;h=ad6065b43ee28e552225c9314761c7f1621363d5;hb=f2b4e7f86be22e755474a03c76f7644092929a70;hp=8f242630ffbaecfb2d12afaea429cb7048b0a27f;hpb=522221f7fb76859b23840bb0c9de0018dae41cbf;p=akkoma diff --git a/test/pleroma/upload_test.exs b/test/pleroma/upload_test.exs index 8f242630f..ad6065b43 100644 --- a/test/pleroma/upload_test.exs +++ b/test/pleroma/upload_test.exs @@ -54,7 +54,7 @@ defmodule Pleroma.UploadTest do assert result == %{ "id" => result["id"], - "name" => "image.jpg", + "name" => "", "type" => "Document", "mediaType" => "image/jpeg", "url" => [ @@ -154,19 +154,6 @@ defmodule Pleroma.UploadTest do "e30397b58d226d6583ab5b8b3c5defb0c682bda5c31ef07a9f57c1c4986e3781.jpg" end - test "copies the file to the configured folder without deduping" do - File.cp!("test/fixtures/image.jpg", "test/fixtures/image_tmp.jpg") - - file = %Plug.Upload{ - content_type: "image/jpeg", - path: Path.absname("test/fixtures/image_tmp.jpg"), - filename: "an [image.jpg" - } - - {:ok, data} = Upload.store(file) - assert data["name"] == "an [image.jpg" - end - test "fixes incorrect content type when base64 is given" do params = %{ img: "data:image/png;base64,#{Base.encode64(File.read!("test/fixtures/image.jpg"))}" @@ -184,7 +171,7 @@ defmodule Pleroma.UploadTest do } {:ok, data} = Upload.store(params) - assert String.ends_with?(data["name"], ".jpg") + assert String.ends_with?(List.first(data["url"])["href"], ".jpg") end test "copies the file to the configured folder with anonymizing filename" do