Skip to content
Snippets Groups Projects
Verified Commit a74daabf authored by Haelwenn's avatar Haelwenn
Browse files

[Pleroma.Web.TwitterAPI.UserViewTest]: Add test for mastodon-fields

parent 82b57eba
No related branches found
No related tags found
No related merge requests found
......@@ -227,4 +227,30 @@ defmodule Pleroma.Web.TwitterAPI.UserViewTest do
blocker = Repo.get(User, blocker.id)
assert represented == UserView.render("show.json", %{user: user, for: blocker})
end
test "a user with mastodon fields" do
fields = [
%{
"name" => "Pronouns",
"value" => "she/her"
},
%{
"name" => "Website",
"value" => "https://example.org/"
}
]
user =
insert(:user, %{
info: %{
"source_data" => %{
"attachment" =>
Enum.map(fields, fn field -> Map.put(field, "type", "PropertyValue") end)
}
}
})
userview = UserView.render("show.json", %{user: user})
assert userview["fields"] == fields
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment