summaryrefslogtreecommitdiff
path: root/test/pleroma/web/mastodon_api/views/account_view_test.exs
diff options
context:
space:
mode:
Diffstat (limited to 'test/pleroma/web/mastodon_api/views/account_view_test.exs')
-rw-r--r--test/pleroma/web/mastodon_api/views/account_view_test.exs18
1 files changed, 11 insertions, 7 deletions
diff --git a/test/pleroma/web/mastodon_api/views/account_view_test.exs b/test/pleroma/web/mastodon_api/views/account_view_test.exs
index 8c77f14d4..5373a17c3 100644
--- a/test/pleroma/web/mastodon_api/views/account_view_test.exs
+++ b/test/pleroma/web/mastodon_api/views/account_view_test.exs
@@ -1,11 +1,10 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.MastodonAPI.AccountViewTest do
use Pleroma.DataCase
- alias Pleroma.Config
alias Pleroma.User
alias Pleroma.UserRelationship
alias Pleroma.Web.CommonAPI
@@ -35,7 +34,8 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do
"<script src=\"invalid-html\"></script><span>valid html</span>. a<br>b<br/>c<br >d<br />f '&<>\"",
inserted_at: ~N[2017-08-15 15:47:06.597036],
emoji: %{"karjalanpiirakka" => "/file.png"},
- raw_bio: "valid html. a\nb\nc\nd\nf '&<>\""
+ raw_bio: "valid html. a\nb\nc\nd\nf '&<>\"",
+ also_known_as: ["https://shitposter.zone/users/shp"]
})
expected = %{
@@ -73,11 +73,13 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do
},
fields: []
},
+ fqn: "shp@shitposter.club",
pleroma: %{
ap_id: user.ap_id,
+ also_known_as: ["https://shitposter.zone/users/shp"],
background_image: "https://example.com/images/asuka_hospital.png",
favicon: nil,
- confirmation_pending: false,
+ is_confirmed: true,
tags: [],
is_admin: false,
is_moderator: false,
@@ -171,11 +173,13 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do
},
fields: []
},
+ fqn: "shp@shitposter.club",
pleroma: %{
ap_id: user.ap_id,
+ also_known_as: [],
background_image: nil,
favicon: nil,
- confirmation_pending: false,
+ is_confirmed: true,
tags: [],
is_admin: false,
is_moderator: false,
@@ -208,7 +212,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do
test "Represent a deactivated user for an admin" do
admin = insert(:user, is_admin: true)
- deactivated_user = insert(:user, deactivated: true)
+ deactivated_user = insert(:user, is_active: false)
represented = AccountView.render("show.json", %{user: deactivated_user, for: admin})
assert represented[:pleroma][:deactivated] == true
end
@@ -553,7 +557,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do
)
with media_preview_enabled <- [false, true] do
- Config.put([:media_preview_proxy, :enabled], media_preview_enabled)
+ clear_config([:media_preview_proxy, :enabled], media_preview_enabled)
AccountView.render("show.json", %{user: user, skip_visibility_check: true})
|> Enum.all?(fn