mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2025-04-10 04:54:08 +00:00
LikeHandlingTest: Add test for invalid content
This commit is contained in:
parent
ef216c922f
commit
950bf60765
1 changed files with 16 additions and 0 deletions
|
@ -126,4 +126,20 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier.LikeHandlingTest do
|
|||
Object.get_by_ap_id(activity.data["object"])
|
||||
|> Object.get_emoji_reactions()
|
||||
end
|
||||
|
||||
test "it works for likes with wrong content" do
|
||||
user = insert(:user)
|
||||
|
||||
{:ok, activity} = CommonAPI.post(user, %{status: "hello"})
|
||||
|
||||
data =
|
||||
File.read!("test/fixtures/mitra-custom-emoji-like.json")
|
||||
|> Jason.decode!()
|
||||
|> Map.put("object", activity.data["object"])
|
||||
|> Map.put("content", 1)
|
||||
|
||||
_actor = insert(:user, ap_id: data["actor"], local: false)
|
||||
|
||||
assert {:error, _} = Transmogrifier.handle_incoming(data)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue