feat: build rel me tags with profile fields
This commit is contained in:
parent
19933a06bf
commit
d5d7648789
2 changed files with 29 additions and 4 deletions
|
|
@ -11,10 +11,23 @@ defmodule Pleroma.Web.Metadata.Providers.RelMeTest do
|
|||
bio =
|
||||
~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">)
|
||||
|
||||
user = insert(:user, %{bio: bio})
|
||||
fields = [
|
||||
%{
|
||||
"name" => "profile",
|
||||
"value" => ~S(<a rel="me" href="http://profile.com">http://profile.com</a>)
|
||||
},
|
||||
%{
|
||||
"name" => "like",
|
||||
"value" => ~S(<a href="http://cofe.io">http://cofe.io</a>)
|
||||
},
|
||||
%{"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: "http://profile.com"], []},
|
||||
{:link, [rel: "me", href: "https://another-link.com"], []}
|
||||
]
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue