diff options
author | lain <lain@soykaf.club> | 2024-12-19 10:47:04 +0000 |
---|---|---|
committer | lain <lain@soykaf.club> | 2024-12-19 10:47:04 +0000 |
commit | 64660423c5540761f3924d342ce60656423b7eb4 (patch) | |
tree | be0e3d2d110f78f83e7fa779d8a12f0f0f54811d /test | |
parent | 16027b769c212095fb6a19d7eaa843a31e91b3ce (diff) | |
parent | 1170dfdd49d9ab0d3a1788db253e88e1bbeb67e1 (diff) | |
download | pleroma-64660423c5540761f3924d342ce60656423b7eb4.tar.gz pleroma-64660423c5540761f3924d342ce60656423b7eb4.zip |
Merge branch 'mergeback/2.8.0' into 'develop'
Mergeback/2.8.0
See merge request pleroma/pleroma!4302
Diffstat (limited to 'test')
-rw-r--r-- | test/pleroma/web/activity_pub/activity_pub_controller_test.exs | 22 |
1 files changed, 22 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 d4175b56f..b627478dc 100644 --- a/test/pleroma/web/activity_pub/activity_pub_controller_test.exs +++ b/test/pleroma/web/activity_pub/activity_pub_controller_test.exs @@ -1644,6 +1644,28 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubControllerTest do assert json_response(conn, 403) end + test "it rejects update activity of object from other actor", %{conn: conn} do + note_activity = insert(:note_activity) + note_object = Object.normalize(note_activity, fetch: false) + user = insert(:user) + + data = %{ + type: "Update", + object: %{ + id: note_object.data["id"] + } + } + + conn = + conn + |> assign(:user, user) + |> put_req_header("content-type", "application/activity+json") + |> post("/users/#{user.nickname}/outbox", data) + + assert json_response(conn, 400) + assert note_object == Object.normalize(note_activity, fetch: false) + end + test "it increases like count when receiving a like action", %{conn: conn} do note_activity = insert(:note_activity) note_object = Object.normalize(note_activity, fetch: false) |