summaryrefslogtreecommitdiff
path: root/test/web/activity_pub/activity_pub_controller_test.exs
diff options
context:
space:
mode:
authorrinpatch <rinpatch@sdf.org>2020-09-08 17:21:12 +0000
committerrinpatch <rinpatch@sdf.org>2020-09-08 17:21:12 +0000
commit425324aae3d4534bc045466a1cc15653ddfa27d2 (patch)
tree2d785eb4396e2dc79bb6b0bed5d766b393479dd5 /test/web/activity_pub/activity_pub_controller_test.exs
parent73dd5bdb7dcdf804bdbabcf632671d4de5042ebc (diff)
parent073f5490ece616fd9602382c1be1347457cbbe79 (diff)
Merge branch 'release/2.1.1' into 'stable'v2.1.1
2.1.1 release See merge request pleroma/secteam/pleroma!13
Diffstat (limited to 'test/web/activity_pub/activity_pub_controller_test.exs')
-rw-r--r--test/web/activity_pub/activity_pub_controller_test.exs16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/web/activity_pub/activity_pub_controller_test.exs b/test/web/activity_pub/activity_pub_controller_test.exs
index 57988dc1e..0517571f2 100644
--- a/test/web/activity_pub/activity_pub_controller_test.exs
+++ b/test/web/activity_pub/activity_pub_controller_test.exs
@@ -905,6 +905,8 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubControllerTest do
end
describe "POST /users/:nickname/outbox (C2S)" do
+ setup do: clear_config([:instance, :limit])
+
setup do
[
activity: %{
@@ -1121,6 +1123,20 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubControllerTest do
assert cirno_object.data["actor"] == cirno.ap_id
assert cirno_object.data["attributedTo"] == cirno.ap_id
end
+
+ test "Character limitation", %{conn: conn, activity: activity} do
+ Pleroma.Config.put([:instance, :limit], 5)
+ user = insert(:user)
+
+ result =
+ conn
+ |> assign(:user, user)
+ |> put_req_header("content-type", "application/activity+json")
+ |> post("/users/#{user.nickname}/outbox", activity)
+ |> json_response(400)
+
+ assert result == "Note is over the character limit"
+ end
end
describe "/relay/followers" do