diff options
author | Mark Felder <feld@FreeBSD.org> | 2020-07-10 11:34:53 -0500 |
---|---|---|
committer | Mark Felder <feld@FreeBSD.org> | 2020-07-10 11:34:53 -0500 |
commit | 3c0c1fd2efa981f18091782434c1f0ac77462b8e (patch) | |
tree | 7776233f9248d4e1caee6ad859af3a524347d926 /test/upload_test.exs | |
parent | d7a37fddd1fc5169ae8c714d0baf8e5372a5f1d5 (diff) | |
parent | ce9514000db1e08a69b8874f21e66261b9261d86 (diff) | |
download | pleroma-3c0c1fd2efa981f18091782434c1f0ac77462b8e.tar.gz pleroma-3c0c1fd2efa981f18091782434c1f0ac77462b8e.zip |
Merge branch 'develop' into issue/1790-updated-oban
Diffstat (limited to 'test/upload_test.exs')
-rw-r--r-- | test/upload_test.exs | 13 |
1 files changed, 13 insertions, 0 deletions
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") |