summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorsxsdv1 <sxsdv1@gmail.com>2019-01-01 22:16:46 +0100
committersxsdv1 <sxsdv1@gmail.com>2019-01-01 23:20:28 +0100
commit551c3d9391c0eeb282d750979b8eef5025c41482 (patch)
treeb6567d32742c87d2c46a6dc86bf0ce4fd56454bf /test
parent32bed664714c616d4a75579b450e52dcff5d8134 (diff)
downloadpleroma-551c3d9391c0eeb282d750979b8eef5025c41482.tar.gz
pleroma-551c3d9391c0eeb282d750979b8eef5025c41482.zip
Split create activity specifics from update_outbox
Diffstat (limited to 'test')
-rw-r--r--test/web/activity_pub/activity_pub_controller_test.exs17
1 files changed, 17 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 cb95e0e09..77dc96617 100644
--- a/test/web/activity_pub/activity_pub_controller_test.exs
+++ b/test/web/activity_pub/activity_pub_controller_test.exs
@@ -192,6 +192,23 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubControllerTest do
result = json_response(conn, 201)
assert Activity.get_by_ap_id(result["id"])
end
+
+ test "it rejects an incoming activity with bogus type", %{conn: conn} do
+ data = File.read!("test/fixtures/activitypub-client-post-activity.json") |> Poison.decode!()
+ user = insert(:user)
+
+ data =
+ data
+ |> Map.put("type", "BadType")
+
+ conn =
+ conn
+ |> assign(:user, user)
+ |> put_req_header("content-type", "application/activity+json")
+ |> post("/users/#{user.nickname}/outbox", data)
+
+ assert json_response(conn, 400)
+ end
end
describe "/users/:nickname/followers" do