aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2020-05-05 10:12:37 +0200
committerlain <lain@soykaf.club>2020-05-05 10:12:37 +0200
commit6400998820084c7b81a53bbeb705b0eb2c0a0e1b (patch)
treeb25f3c8b1e9b933a30ce22d8a0f0050b3643bf05 /test
parentb1c29e2de8a02ef3093387c1454d290a92fbdef8 (diff)
downloadpleroma-6400998820084c7b81a53bbeb705b0eb2c0a0e1b.tar.gz
AP C2S: Restrict creation to `Note`s for now.
Diffstat (limited to 'test')
-rw-r--r--test/web/activity_pub/activity_pub_controller_test.exs15
1 files changed, 15 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 a8f1f0e26..9a085ffc5 100644
--- a/test/web/activity_pub/activity_pub_controller_test.exs
+++ b/test/web/activity_pub/activity_pub_controller_test.exs
@@ -815,6 +815,21 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubControllerTest do
assert object["content"] == activity["object"]["content"]
end
+ test "it rejects anything beyond 'Note' creations", %{conn: conn, activity: activity} do
+ user = insert(:user)
+
+ activity =
+ activity
+ |> put_in(["object", "type"], "Benis")
+
+ _result =
+ conn
+ |> assign(:user, user)
+ |> put_req_header("content-type", "application/activity+json")
+ |> post("/users/#{user.nickname}/outbox", activity)
+ |> json_response(400)
+ end
+
test "it inserts an incoming sensitive activity into the database", %{
conn: conn,
activity: activity