diff options
author | Mark Felder <feld@FreeBSD.org> | 2020-07-13 13:32:21 -0500 |
---|---|---|
committer | Mark Felder <feld@FreeBSD.org> | 2020-07-13 13:32:21 -0500 |
commit | 80c21100db306ce45856bbdb97d3439676babeeb (patch) | |
tree | d143f523da262df5176220fbe6dc0b6370c91ebc /test/upload_test.exs | |
parent | ce85db41a30d95555bbd44d8931c4a3a357938d8 (diff) | |
parent | 5d215fd81f529b639db9096ca71d4e7f0a6ed386 (diff) | |
download | pleroma-80c21100db306ce45856bbdb97d3439676babeeb.tar.gz pleroma-80c21100db306ce45856bbdb97d3439676babeeb.zip |
Merge branch 'develop' into refactor/notification_settings
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") |