1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Web.ActivityPub.Transmogrifier.EventHandlingTest do
6 use Oban.Testing, repo: Pleroma.Repo
9 alias Pleroma.Object.Fetcher
11 test "Mobilizon Event object" do
13 %{url: "https://mobilizon.org/events/252d5816-00a3-4a89-a66f-15bf65c33e39"} ->
16 body: File.read!("test/fixtures/tesla_mock/mobilizon.org-event.json"),
17 headers: HttpRequestMock.activitypub_object_headers()
20 %{url: "https://mobilizon.org/@tcit"} ->
23 body: File.read!("test/fixtures/tesla_mock/mobilizon.org-user.json"),
24 headers: HttpRequestMock.activitypub_object_headers()
28 assert {:ok, object} =
29 Fetcher.fetch_object_from_id(
30 "https://mobilizon.org/events/252d5816-00a3-4a89-a66f-15bf65c33e39"
33 assert object.data["to"] == ["https://www.w3.org/ns/activitystreams#Public"]
34 assert object.data["cc"] == ["https://mobilizon.org/@tcit/followers"]
36 assert object.data["url"] ==
37 "https://mobilizon.org/events/252d5816-00a3-4a89-a66f-15bf65c33e39"
39 assert object.data["published"] == "2019-12-17T11:33:56Z"
40 assert object.data["name"] == "Mobilizon Launching Party"