1 defmodule Pleroma.Web.MastodonAPI.AccountViewTest do
4 alias Pleroma.Web.MastodonAPI.AccountView
7 test "Represent a user account" do
10 info: %{"note_count" => 5, "follower_count" => 3},
11 nickname: "shp@shitposter.club",
12 inserted_at: ~N[2017-08-15 15:47:06.597036]
16 id: to_string(user.id),
19 display_name: user.name,
21 created_at: "2017-08-15T15:47:06.000Z",
27 avatar: "http://localhost:4001/images/avi.png",
28 avatar_static: "http://localhost:4001/images/avi.png",
29 header: "http://localhost:4001/images/banner.png",
30 header_static: "http://localhost:4001/images/banner.png",
40 assert expected == AccountView.render("account.json", %{user: user})
43 test "Represent a smaller mention" do
47 id: to_string(user.id),
49 username: user.nickname,
53 assert expected == AccountView.render("mention.json", %{user: user})
56 test "represent a relationship" do
58 other_user = insert(:user)
60 {:ok, user} = User.follow(user, other_user)
61 {:ok, user} = User.block(user, other_user)
64 id: to_string(other_user.id),
70 domain_blocking: false
73 assert expected == AccountView.render("relationship.json", %{user: user, target: other_user})