diff options
author | Mark Felder <feld@FreeBSD.org> | 2020-07-09 09:08:59 -0500 |
---|---|---|
committer | Mark Felder <feld@FreeBSD.org> | 2020-07-09 09:08:59 -0500 |
commit | 49c4e2495357797caa82b4eb0a4d03e8c8dd2730 (patch) | |
tree | 7295ba98c7833534622a9c7fb27580691fbc06a5 /test/upload_test.exs | |
parent | da4029391d217b1e2c151e69479de42e2221e02f (diff) | |
parent | 8ca1f3e8c61b906387e9cb6fb8993d2ad496ab3d (diff) | |
download | pleroma-49c4e2495357797caa82b4eb0a4d03e8c8dd2730.tar.gz pleroma-49c4e2495357797caa82b4eb0a4d03e8c8dd2730.zip |
Merge branch 'develop' into fix/csp-for-captcha
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") |