forked from YokaiRick/akkoma
tests: add a testcase for verifying that objects without a valid ID are always rejected
This commit is contained in:
parent
52b44184b4
commit
bc36d40bee
1 changed files with 12 additions and 0 deletions
|
@ -615,6 +615,18 @@ test "it works for incoming rejects which are referenced by IRI only" do
|
||||||
|
|
||||||
assert User.following?(follower, followed) == false
|
assert User.following?(follower, followed) == false
|
||||||
end
|
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
|
end
|
||||||
|
|
||||||
describe "prepare outgoing" do
|
describe "prepare outgoing" do
|
||||||
|
|
Loading…
Reference in a new issue