X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=test%2Fweb%2Fmetadata%2Fopengraph_test.exs;h=4283f72cdf22b588cef6619c8180f1c210ed43f3;hb=7a318d74e64fd0df9b3be202810dee2119862aba;hp=672942148756b1e5a31fff8565f365612e49a330;hpb=3b187896847637d93db194897565599acd73a57c;p=akkoma diff --git a/test/web/metadata/opengraph_test.exs b/test/web/metadata/opengraph_test.exs index 672942148..4283f72cd 100644 --- a/test/web/metadata/opengraph_test.exs +++ b/test/web/metadata/opengraph_test.exs @@ -1,6 +1,7 @@ # Pleroma: A lightweight social networking server # Copyright © 2017-2019 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only + defmodule Pleroma.Web.Metadata.Providers.OpenGraphTest do use Pleroma.DataCase import Pleroma.Factory @@ -14,6 +15,7 @@ defmodule Pleroma.Web.Metadata.Providers.OpenGraphTest do data: %{ "actor" => user.ap_id, "tag" => [], + "id" => "https://pleroma.gov/objects/whatever", "content" => "pleroma in a nutshell", "attachment" => [ %{ @@ -46,19 +48,7 @@ defmodule Pleroma.Web.Metadata.Providers.OpenGraphTest do } }) - note_activity = - insert(:note_activity, %{ - data: %{ - "actor" => note.data["actor"], - "to" => note.data["to"], - "object" => note.data, - "context" => note.data["context"] - }, - actor: note.data["actor"], - recipients: note.data["to"] - }) - - result = OpenGraph.build_tags(%{activity: note_activity, user: user}) + result = OpenGraph.build_tags(%{object: note, url: note.data["id"], user: user}) assert Enum.all?( [ @@ -81,8 +71,10 @@ defmodule Pleroma.Web.Metadata.Providers.OpenGraphTest do insert(:note, %{ data: %{ "actor" => user.ap_id, + "id" => "https://pleroma.gov/objects/whatever", "content" => "#cuteposting #nsfw #hambaga", "tag" => ["cuteposting", "nsfw", "hambaga"], + "sensitive" => true, "attachment" => [ %{ "url" => [ @@ -93,19 +85,7 @@ defmodule Pleroma.Web.Metadata.Providers.OpenGraphTest do } }) - note_activity = - insert(:note_activity, %{ - data: %{ - "actor" => note.data["actor"], - "to" => note.data["to"], - "object" => note.data, - "context" => note.data["context"] - }, - actor: note.data["actor"], - recipients: note.data["to"] - }) - - result = OpenGraph.build_tags(%{activity: note_activity, user: user}) + result = OpenGraph.build_tags(%{object: note, url: note.data["id"], user: user}) assert {:meta, [property: "og:image", content: "https://pleroma.gov/tenshi.png"], []} in result