aboutsummaryrefslogtreecommitdiff
path: root/test/upload_test.exs
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2020-07-08 13:23:07 +0200
committerlain <lain@soykaf.club>2020-07-08 13:23:07 +0200
commit7d0e2b3fdd001b45741d97ee9c7833a69d6fb5ef (patch)
treedc88ef36e04c083bc3c34255092677af1a81ce55 /test/upload_test.exs
parenta6a12b241fbacd3ff35cd901190e62d14aaac3c2 (diff)
parent6335b32aa8f5c54cf5f09638189a77cad5785077 (diff)
downloadpleroma-7d0e2b3fdd001b45741d97ee9c7833a69d6fb5ef.tar.gz
Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into follow-pipeline
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")