X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=test%2Fupload_test.exs;h=b06b54487e152dc397e3127930e481cefbaedace;hb=89a2433154b05c378f9c5b3224375049f3dbc8af;hp=060a940bbaaa88e77042b903f1cbd0471cc63def;hpb=dfd2c741849e9afaf35e3ddbecbb50feb47f5d22;p=akkoma diff --git a/test/upload_test.exs b/test/upload_test.exs index 060a940bb..b06b54487 100644 --- a/test/upload_test.exs +++ b/test/upload_test.exs @@ -54,6 +54,7 @@ defmodule Pleroma.UploadTest do %{ "name" => "image.jpg", "type" => "Document", + "mediaType" => "image/jpeg", "url" => [ %{ "href" => "http://localhost:4001/media/post-process-file.jpg", @@ -106,6 +107,19 @@ defmodule Pleroma.UploadTest do describe "Storing a file with the Local uploader" do setup [:ensure_local_uploader] + test "does not allow descriptions longer than the post limit" do + clear_config([:instance, :description_limit], 2) + 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: "image.jpg" + } + + {:error, :description_too_long} = Upload.store(file, description: "123") + end + test "returns a media url" do File.cp!("test/fixtures/image.jpg", "test/fixtures/image_tmp.jpg")