summaryrefslogtreecommitdiff
path: root/test/web/common_api/common_api_test.exs
diff options
context:
space:
mode:
authorMark Felder <feld@FreeBSD.org>2020-03-10 13:08:00 -0500
committerrinpatch <rinpatch@sdf.org>2020-03-15 16:58:13 +0300
commitf8dc597c51ef294311687e5f3ff468635779638f (patch)
tree71b2a7e34d6f0f9703f0584e22a1c540553035f4 /test/web/common_api/common_api_test.exs
parent423cfaf141afb03676aeb5e0f377be67e89092fc (diff)
downloadpleroma-f8dc597c51ef294311687e5f3ff468635779638f.tar.gz
pleroma-f8dc597c51ef294311687e5f3ff468635779638f.zip
Fix enforcement of character limits
Diffstat (limited to 'test/web/common_api/common_api_test.exs')
-rw-r--r--test/web/common_api/common_api_test.exs4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/web/common_api/common_api_test.exs b/test/web/common_api/common_api_test.exs
index 299d968db..b80523160 100644
--- a/test/web/common_api/common_api_test.exs
+++ b/test/web/common_api/common_api_test.exs
@@ -202,13 +202,15 @@ defmodule Pleroma.Web.CommonAPITest do
CommonAPI.post(user, %{"status" => ""})
end
- test "it returns error when character limit is exceeded" do
+ test "it validates character limits are correctly enforced" do
Pleroma.Config.put([:instance, :limit], 5)
user = insert(:user)
assert {:error, "The status is over the character limit"} =
CommonAPI.post(user, %{"status" => "foobar"})
+
+ assert {:ok, activity} = CommonAPI.post(user, %{"status" => "12345"})
end
test "it can handle activities that expire" do