X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=test%2Fupload_test.exs;h=b06b54487e152dc397e3127930e481cefbaedace;hb=77b1ea68a7700ac4a78c7f2e0ea9f118441d23da;hp=2abf0edec6b6ee61d7342923eb5749b7bfd57f1a;hpb=3b5282bef29656f081750a0d9b06a42b912520de;p=akkoma diff --git a/test/upload_test.exs b/test/upload_test.exs index 2abf0edec..b06b54487 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")