summaryrefslogtreecommitdiff
path: root/test/upload_test.exs
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2020-07-27 16:35:47 +0000
committerlain <lain@soykaf.club>2020-07-27 16:35:47 +0000
commite1a1c8e7de5e10fa64d168dc5d35a80b96767395 (patch)
treec0057448e323c730bea2c76cecf9efb85ef14181 /test/upload_test.exs
parent4a6389316dac53c1ca2ec36d160690476d881185 (diff)
parent2a3abfd326f0cbb588dfe66a23e9783be3038a5e (diff)
downloadpleroma-e1a1c8e7de5e10fa64d168dc5d35a80b96767395.tar.gz
pleroma-e1a1c8e7de5e10fa64d168dc5d35a80b96767395.zip
Merge branch 'develop' into 'cleanup/masto_fe-default_settings'
# Conflicts: # lib/pleroma/web/views/masto_fe_view.ex
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")