Use info.fields instead of source_data for remote users

This commit is contained in:
Egor Kislitsyn 2019-08-06 18:21:25 +07:00
commit f7bbf99caa
10 changed files with 91 additions and 39 deletions

View file

@ -518,9 +518,9 @@ defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do
user = User.get_cached_by_ap_id(activity.actor)
assert user.info.source_data["attachment"] == [
%{"name" => "foo", "type" => "PropertyValue", "value" => "bar"},
%{"name" => "foo1", "type" => "PropertyValue", "value" => "bar1"}
assert User.Info.fields(user.info) == [
%{"name" => "foo", "value" => "bar"},
%{"name" => "foo1", "value" => "bar1"}
]
update_data = File.read!("test/fixtures/mastodon-update.json") |> Poison.decode!()
@ -539,9 +539,9 @@ defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do
user = User.get_cached_by_ap_id(user.ap_id)
assert user.info.source_data["attachment"] == [
%{"name" => "foo", "type" => "PropertyValue", "value" => "updated"},
%{"name" => "foo1", "type" => "PropertyValue", "value" => "updated"}
assert User.Info.fields(user.info) == [
%{"name" => "foo", "value" => "updated"},
%{"name" => "foo1", "value" => "updated"}
]
end