2019-07-10 07:13:23 +02:00
|
|
|
# Pleroma: A lightweight social networking server
|
2021-01-13 07:49:20 +01:00
|
|
|
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
|
2019-07-10 07:13:23 +02:00
|
|
|
# SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2019-04-19 09:50:21 +02:00
|
|
|
defmodule Pleroma.Web.Metadata.Providers.RelMeTest do
|
2020-12-21 12:21:40 +01:00
|
|
|
use Pleroma.DataCase, async: true
|
2019-04-19 09:50:21 +02:00
|
|
|
import Pleroma.Factory
|
|
|
|
alias Pleroma.Web.Metadata.Providers.RelMe
|
|
|
|
|
|
|
|
test "it renders all links with rel='me' from user bio" do
|
|
|
|
bio =
|
2020-02-10 22:29:25 +01:00
|
|
|
~s(<a href="https://some-link.com">https://some-link.com</a> <a rel="me" href="https://another-link.com">https://another-link.com</a> <link href="http://some.com"> <link rel="me" href="http://some3.com">)
|
2020-07-16 20:09:48 +02:00
|
|
|
|
2019-04-19 09:50:21 +02:00
|
|
|
user = insert(:user, %{bio: bio})
|
|
|
|
|
|
|
|
assert RelMe.build_tags(%{user: user}) == [
|
2020-02-10 22:29:25 +01:00
|
|
|
{:link, [rel: "me", href: "http://some3.com"], []},
|
2019-04-19 09:50:21 +02:00
|
|
|
{:link, [rel: "me", href: "https://another-link.com"], []}
|
|
|
|
]
|
|
|
|
end
|
|
|
|
end
|