X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=test%2Fupload_test.exs;h=4280bfcacca7147e4b05d3ef551c448346d8ebdc;hb=55562ca9362d66553ea3638c91174bbeb6c637f1;hp=c7ad177d9ef464f4c1b195d0a3d7d3b6957fad67;hpb=39f7fc5b8ef781c98136d1f9be50a14bff394233;p=akkoma diff --git a/test/upload_test.exs b/test/upload_test.exs index c7ad177d9..4280bfcac 100644 --- a/test/upload_test.exs +++ b/test/upload_test.exs @@ -107,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")