test case for incoming private comments

This commit is contained in:
Mayel
2021-10-19 17:21:00 +13:00
committed by Thomas Citharel
parent f4736bd1b9
commit 8cb7df16d0
2 changed files with 75 additions and 0 deletions

View File

@@ -117,6 +117,16 @@ defmodule Mobilizon.Federation.ActivityPub.Transmogrifier.CommentsTest do
end) =~ "[warn] Parent object is something we don't handle"
end
test "it ignores incoming private notes" do
data = File.read!("test/fixtures/mastodon-post-activity-private.json") |> Jason.decode!()
event = insert(:event)
object = data["object"]
object = Map.put(object, "inReplyTo", event.url)
data = Map.put(data, "object", object)
:error = Transmogrifier.handle_incoming(data)
end
test "it works for incoming notices" do
data = File.read!("test/fixtures/mastodon-post-activity.json") |> Jason.decode!()