Federation fixes

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2021-11-19 17:40:42 +01:00
parent fbf2d480a3
commit d7fd30f8e6
10 changed files with 53 additions and 250 deletions

View File

@@ -119,7 +119,7 @@ defmodule Mobilizon.Federation.ActivityPub.TransmogrifierTest do
assert object["to"] == ["https://www.w3.org/ns/activitystreams#Public"]
assert object["cc"] == []
# assert object["cc"] == []
assert object["actor"] == "https://demo.gancio.org/federation/u/gancio"
assert object["location"]["name"] == "Colosseo"
@@ -146,11 +146,14 @@ defmodule Mobilizon.Federation.ActivityPub.TransmogrifierTest do
preferred_username: "member"
)
relay = Relay.get_actor()
with_mock ActivityPubActor, [:passthrough],
get_or_fetch_actor_by_url: fn url ->
case url do
^group_url -> {:ok, group}
^actor_url -> {:ok, actor}
"https://www.w3.org/ns/activitystreams#Public" -> {:ok, relay}
end
end do
data = File.read!("test/fixtures/mobilizon-post-activity-group.json") |> Jason.decode!()