diff options
| author | Mark Felder <feld@FreeBSD.org> | 2020-09-09 11:11:36 -0500 |
|---|---|---|
| committer | Mark Felder <feld@FreeBSD.org> | 2020-09-09 11:11:36 -0500 |
| commit | 4ee99dafccd6f7c037270d6bac5e942f322c7efd (patch) | |
| tree | 5437905333bb1f2d37488dab6597e647d6776c39 /test/web/activity_pub/activity_pub_controller_test.exs | |
| parent | 563718cab9eb5cf07fd20786697c01b8647db084 (diff) | |
| parent | 9d20d29a79f4ea0756f4e2c7f387674f57513b6d (diff) | |
| download | pleroma-4ee99dafccd6f7c037270d6bac5e942f322c7efd.tar.gz pleroma-4ee99dafccd6f7c037270d6bac5e942f322c7efd.zip | |
Merge branch 'develop' into media-preview-proxy
Diffstat (limited to 'test/web/activity_pub/activity_pub_controller_test.exs')
| -rw-r--r-- | test/web/activity_pub/activity_pub_controller_test.exs | 16 |
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 |
