summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authortusooa <tusooa@kazv.moe>2024-10-08 23:09:59 -0400
committertusooa <tusooa@kazv.moe>2024-10-08 23:09:59 -0400
commitf758b6e37c80f5adeba74009e1cc72a420937a30 (patch)
tree37d04174deb5a7eea593ee52b801ea991bcfa30c /test
parent07cfbe4ae8b97b0afd4060303d07e224499a37cb (diff)
downloadpleroma-f758b6e37c80f5adeba74009e1cc72a420937a30.tar.gz
pleroma-f758b6e37c80f5adeba74009e1cc72a420937a30.zip
Fix incoming Blocks being rejected
Diffstat (limited to 'test')
-rw-r--r--test/pleroma/web/activity_pub/activity_pub_controller_test.exs21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/pleroma/web/activity_pub/activity_pub_controller_test.exs b/test/pleroma/web/activity_pub/activity_pub_controller_test.exs
index 3bd589f49..d4175b56f 100644
--- a/test/pleroma/web/activity_pub/activity_pub_controller_test.exs
+++ b/test/pleroma/web/activity_pub/activity_pub_controller_test.exs
@@ -1320,6 +1320,27 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubControllerTest do
html_body: ~r/#{note.data["object"]}/i
)
end
+
+ test "it accepts an incoming Block", %{conn: conn, data: data} do
+ user = insert(:user)
+
+ data =
+ data
+ |> Map.put("type", "Block")
+ |> Map.put("to", [user.ap_id])
+ |> Map.put("cc", [])
+ |> Map.put("object", user.ap_id)
+
+ conn =
+ conn
+ |> assign(:valid_signature, true)
+ |> put_req_header("content-type", "application/activity+json")
+ |> post("/users/#{user.nickname}/inbox", data)
+
+ assert "ok" == json_response(conn, 200)
+ ObanHelpers.perform(all_enqueued(worker: ReceiverWorker))
+ assert Activity.get_by_ap_id(data["id"])
+ end
end
describe "GET /users/:nickname/outbox" do