diff options
author | lain <lain@soykaf.club> | 2020-03-10 18:16:10 +0000 |
---|---|---|
committer | lain <lain@soykaf.club> | 2020-03-10 18:16:10 +0000 |
commit | 953aece84866a89bd3de8f6d3f5d30e2f9cfb4f3 (patch) | |
tree | 8a2b031830f96f94b3b4c12b4da16cfd80579d88 /test/web/common_api/common_api_test.exs | |
parent | 841e4e4d835b8d1cecb33102356ca045571ef1fc (diff) | |
parent | 5af798f24659a1558149cf6deddfa55fbc493ac2 (diff) | |
download | pleroma-953aece84866a89bd3de8f6d3f5d30e2f9cfb4f3.tar.gz pleroma-953aece84866a89bd3de8f6d3f5d30e2f9cfb4f3.zip |
Merge branch 'fix/post-length-validation' into 'develop'
Fix enforcement of character limits
Closes #1618
See merge request pleroma/pleroma!2283
Diffstat (limited to 'test/web/common_api/common_api_test.exs')
-rw-r--r-- | test/web/common_api/common_api_test.exs | 4 |
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 |