summaryrefslogtreecommitdiff
path: root/test/upload_test.exs
diff options
context:
space:
mode:
authorAlex Gleason <alex@alexgleason.me>2020-07-16 14:51:36 -0500
committerAlex Gleason <alex@alexgleason.me>2020-07-16 14:51:36 -0500
commit38425ebdbf157377ccb0402f78dc3d02f81c55f5 (patch)
tree740f32837d28e918f097c948d89827d99434d5b2 /test/upload_test.exs
parent8daacc911498d827fd68ea3d34eb1be9ae4a1ffe (diff)
parent3a2b2cb6f2d6ce39ae0d246649189c021c535992 (diff)
downloadpleroma-38425ebdbf157377ccb0402f78dc3d02f81c55f5.tar.gz
pleroma-38425ebdbf157377ccb0402f78dc3d02f81c55f5.zip
Merge remote-tracking branch 'upstream/develop' into linkify
Diffstat (limited to 'test/upload_test.exs')
-rw-r--r--test/upload_test.exs13
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")