1 defmodule Pleroma.Web.MastodonAPI.AccountViewTest do
4 alias Pleroma.Web.MastodonAPI.AccountView
7 test "Represent a user account" do
8 user = insert(:user, %{info: %{"note_count" => 5, "follower_count" => 3}, nickname: "shp@shitposter.club"})
14 display_name: user.name,
16 created_at: user.inserted_at,
22 avatar: "https://placehold.it/48x48",
23 avatar_static: "https://placehold.it/48x48",
24 header: "https://placehold.it/700x335",
25 header_static: "https://placehold.it/700x335"
28 assert expected == AccountView.render("account.json", %{user: user})
31 test "Represent a smaller mention" do
37 username: user.nickname,
41 assert expected == AccountView.render("mention.json", %{user: user})
44 test "represent a relationship" do
46 other_user = insert(:user)
48 {:ok, user} = User.follow(user, other_user)
57 domain_blocking: false
60 assert expected == AccountView.render("relationship.json", %{user: user, target: other_user})