Use info.fields instead of source_data for remote users
This commit is contained in:
parent
2c35d4b0b0
commit
f7bbf99caa
10 changed files with 91 additions and 39 deletions
|
|
@ -24,21 +24,16 @@ defmodule Pleroma.Web.ActivityPub.UserViewTest do
|
|||
|
||||
test "Renders profile fields" do
|
||||
fields = [
|
||||
%{"name" => "foo", "value" => "bar"},
|
||||
%{"name" => "website", "value" => "cofe.my"}
|
||||
%{"name" => "foo", "value" => "bar"}
|
||||
]
|
||||
|
||||
user = insert(:user, info: %{fields: fields})
|
||||
{:ok, user} =
|
||||
insert(:user)
|
||||
|> User.upgrade_changeset(%{info: %{fields: fields}})
|
||||
|> User.update_and_set_cache()
|
||||
|
||||
assert %{
|
||||
"attachment" => [
|
||||
%{"name" => "foo", "type" => "PropertyValue", "value" => "bar"},
|
||||
%{
|
||||
"name" => "website",
|
||||
"type" => "PropertyValue",
|
||||
"value" => "<a href=\"http://cofe.my\">cofe.my</a>"
|
||||
}
|
||||
]
|
||||
"attachment" => [%{"name" => "foo", "type" => "PropertyValue", "value" => "bar"}]
|
||||
} = UserView.render("user.json", %{user: user})
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue