# Pleroma: A lightweight social networking server # Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Metadata.Providers.RelMeTest do use Pleroma.DataCase, async: true import Pleroma.Factory alias Pleroma.Web.Metadata.Providers.RelMe test "it renders all links with rel='me' from user bio" do bio = ~s(https://some-link.com https://another-link.com ) fields = [ %{ "name" => "profile", "value" => ~S(http://profile.com) }, %{ "name" => "like", "value" => ~S(http://cofe.io) }, %{"name" => "foo", "value" => "bar"} ] user = insert(:user, %{bio: bio, fields: fields}) assert RelMe.build_tags(%{user: user}) == [ {:link, [rel: "me", href: "http://some3.com"], []}, {:link, [rel: "me", href: "https://another-link.com"], []}, {:link, [rel: "me", href: "http://profile.com"], []} ] end end