diff options
| author | Alex Gleason <alex@alexgleason.me> | 2020-10-08 17:24:09 -0500 |
|---|---|---|
| committer | Alex Gleason <alex@alexgleason.me> | 2020-10-08 17:24:09 -0500 |
| commit | 3f9263fb16ad519d2dd45106549a8ba42b68fc1f (patch) | |
| tree | a48eb564f7f037a876a4d2131f8571aa33702b22 /test/web/activity_pub/activity_pub_controller_test.exs | |
| parent | 24ce9c011caf7401fb261c7df4196b2ef9ba3d90 (diff) | |
| parent | 74be4de3f6c2c34447029649526637411acfa9f3 (diff) | |
| download | pleroma-3f9263fb16ad519d2dd45106549a8ba42b68fc1f.tar.gz pleroma-3f9263fb16ad519d2dd45106549a8ba42b68fc1f.zip | |
Merge remote-tracking branch 'upstream/develop' into restrict-origin
Diffstat (limited to 'test/web/activity_pub/activity_pub_controller_test.exs')
| -rw-r--r-- | test/web/activity_pub/activity_pub_controller_test.exs | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/test/web/activity_pub/activity_pub_controller_test.exs b/test/web/activity_pub/activity_pub_controller_test.exs index ed900d8f8..0517571f2 100644 --- a/test/web/activity_pub/activity_pub_controller_test.exs +++ b/test/web/activity_pub/activity_pub_controller_test.exs @@ -533,7 +533,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubControllerTest do end) :ok = Mix.Tasks.Pleroma.Relay.run(["list"]) - assert_receive {:mix_shell, :info, ["relay.mastodon.host"]} + assert_receive {:mix_shell, :info, ["https://relay.mastodon.host/actor"]} end @tag capture_log: true @@ -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 |
