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.PageHandlingTest do
6 use Oban.Testing, repo: Pleroma.Repo
9 alias Pleroma.Object.Fetcher
13 %{url: "https://enterprise.lemmy.ml/post/3"} ->
16 headers: [{"content-type", "application/activity+json"}],
17 body: File.read!("test/fixtures/tesla_mock/lemmy-page.json")
20 %{url: "https://enterprise.lemmy.ml/u/nutomic"} ->
23 headers: [{"content-type", "application/activity+json"}],
24 body: File.read!("test/fixtures/tesla_mock/lemmy-user.json")
28 {:ok, object} = Fetcher.fetch_object_from_id("https://enterprise.lemmy.ml/post/3")
30 assert object.data["summary"] == "Hello Federation!"
31 assert object.data["published"] == "2020-09-14T15:03:11.909105Z"
34 assert object.data["url"] == "https://enterprise.lemmy.ml/pictrs/image/US52d9DPvf.jpg"