defmodule Pleroma.Web.MastodonAPI.AccountViewTest do
use Pleroma.DataCase
import Pleroma.Factory
- alias Pleroma.Web.MastodonAPI.AccountView
alias Pleroma.User
+ alias Pleroma.Web.MastodonAPI.AccountView
test "Represent a user account" do
source_data = %{
assert expected == AccountView.render("account.json", %{user: user})
end
+ test "Represent the user account for the account owner" do
+ user = insert(:user)
+
+ notification_settings = %{
+ "remote" => true,
+ "local" => true,
+ "followers" => true,
+ "follows" => true
+ }
+
+ assert %{pleroma: %{notification_settings: ^notification_settings}} =
+ AccountView.render("account.json", %{user: user, for: user})
+ end
+
test "Represent a Service(bot) account" do
user =
insert(:user, %{
blocking: true,
muting: false,
muting_notifications: false,
+ subscribing: false,
requested: false,
domain_blocking: false,
- showing_reblogs: false,
+ showing_reblogs: true,
endorsed: false
}
following: false,
followed_by: false,
blocking: true,
+ subscribing: false,
muting: false,
muting_notifications: false,
requested: false,
domain_blocking: false,
- showing_reblogs: false,
+ showing_reblogs: true,
endorsed: false
}
}