1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2024 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Web.RichMedia.Parser.TTL.OpengraphTest do
7 use Oban.Testing, repo: Pleroma.Repo
11 alias Pleroma.UnstubbedConfigMock, as: ConfigMock
12 alias Pleroma.Web.RichMedia.Card
16 |> stub_with(Pleroma.Test.StaticConfig)
18 clear_config([:rich_media, :enabled], true)
23 test "OpenGraph TTL value is honored" do
24 url = "https://reddit.com/r/somepost"
31 %Tesla.Env{status: 200, body: File.read!("test/fixtures/rich_media/reddit.html")}
34 %Tesla.Env{status: 200}
37 Card.get_or_backfill_by_url(url)
39 assert_enqueued(worker: Pleroma.Workers.RichMediaExpirationWorker, args: %{"url" => url})