tests: add a testcase for verifying that objects without a valid ID are always rejected

This commit is contained in:
William Pitcock 2018-08-23 00:55:41 +00:00
parent 52b44184b4
commit bc36d40bee

View File

@ -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