From: William Pitcock Date: Thu, 23 Aug 2018 00:55:41 +0000 (+0000) Subject: tests: add a testcase for verifying that objects without a valid ID are always rejected X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=bc36d40bee790c57d8e422d75c1999bdc8f4c031;p=akkoma tests: add a testcase for verifying that objects without a valid ID are always rejected --- diff --git a/test/web/activity_pub/transmogrifier_test.exs b/test/web/activity_pub/transmogrifier_test.exs index e455da39f..e2926d495 100644 --- a/test/web/activity_pub/transmogrifier_test.exs +++ b/test/web/activity_pub/transmogrifier_test.exs @@ -615,6 +615,18 @@ defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do assert User.following?(follower, followed) == false end + + test "it rejects activities without a valid ID" do + user = insert(:user) + + data = + File.read!("test/fixtures/mastodon-follow-activity.json") + |> Poison.decode!() + |> Map.put("object", user.ap_id) + |> Map.put("id", "") + + :error = Transmogrifier.handle_incoming(data) + end end describe "prepare outgoing" do