summaryrefslogtreecommitdiff
path: root/test/web/mastodon_api/views
diff options
context:
space:
mode:
authorMark Felder <feld@FreeBSD.org>2020-09-09 11:11:36 -0500
committerMark Felder <feld@FreeBSD.org>2020-09-09 11:11:36 -0500
commit4ee99dafccd6f7c037270d6bac5e942f322c7efd (patch)
tree5437905333bb1f2d37488dab6597e647d6776c39 /test/web/mastodon_api/views
parent563718cab9eb5cf07fd20786697c01b8647db084 (diff)
parent9d20d29a79f4ea0756f4e2c7f387674f57513b6d (diff)
downloadpleroma-4ee99dafccd6f7c037270d6bac5e942f322c7efd.tar.gz
pleroma-4ee99dafccd6f7c037270d6bac5e942f322c7efd.zip
Merge branch 'develop' into media-preview-proxy
Diffstat (limited to 'test/web/mastodon_api/views')
-rw-r--r--test/web/mastodon_api/views/account_view_test.exs39
1 files changed, 19 insertions, 20 deletions
diff --git a/test/web/mastodon_api/views/account_view_test.exs b/test/web/mastodon_api/views/account_view_test.exs
index 2f56d9c8f..5c5aa6cee 100644
--- a/test/web/mastodon_api/views/account_view_test.exs
+++ b/test/web/mastodon_api/views/account_view_test.exs
@@ -5,7 +5,6 @@
defmodule Pleroma.Web.MastodonAPI.AccountViewTest do
use Pleroma.DataCase
- alias Pleroma.Config
alias Pleroma.User
alias Pleroma.UserRelationship
alias Pleroma.Web.CommonAPI
@@ -19,8 +18,6 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do
:ok
end
- setup do: clear_config([:instances_favicons, :enabled])
-
test "Represent a user account" do
background_image = %{
"url" => [%{"href" => "https://example.com/images/asuka_hospital.png"}]
@@ -78,8 +75,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do
pleroma: %{
ap_id: user.ap_id,
background_image: "https://example.com/images/asuka_hospital.png",
- favicon:
- "https://shitposter.club/plugins/Qvitter/img/gnusocial-favicons/favicon-16x16.png",
+ favicon: nil,
confirmation_pending: false,
tags: [],
is_admin: false,
@@ -98,22 +94,26 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do
assert expected == AccountView.render("show.json", %{user: user, skip_visibility_check: true})
end
- test "Favicon is nil when :instances_favicons is disabled" do
- user = insert(:user)
-
- Config.put([:instances_favicons, :enabled], true)
+ describe "favicon" do
+ setup do
+ [user: insert(:user)]
+ end
- assert %{
- pleroma: %{
- favicon:
- "https://shitposter.club/plugins/Qvitter/img/gnusocial-favicons/favicon-16x16.png"
- }
- } = AccountView.render("show.json", %{user: user, skip_visibility_check: true})
+ test "is parsed when :instance_favicons is enabled", %{user: user} do
+ clear_config([:instances_favicons, :enabled], true)
- Config.put([:instances_favicons, :enabled], false)
+ assert %{
+ pleroma: %{
+ favicon:
+ "https://shitposter.club/plugins/Qvitter/img/gnusocial-favicons/favicon-16x16.png"
+ }
+ } = AccountView.render("show.json", %{user: user, skip_visibility_check: true})
+ end
- assert %{pleroma: %{favicon: nil}} =
- AccountView.render("show.json", %{user: user, skip_visibility_check: true})
+ test "is nil when :instances_favicons is disabled", %{user: user} do
+ assert %{pleroma: %{favicon: nil}} =
+ AccountView.render("show.json", %{user: user, skip_visibility_check: true})
+ end
end
test "Represent the user account for the account owner" do
@@ -173,8 +173,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do
pleroma: %{
ap_id: user.ap_id,
background_image: nil,
- favicon:
- "https://shitposter.club/plugins/Qvitter/img/gnusocial-favicons/favicon-16x16.png",
+ favicon: nil,
confirmation_pending: false,
tags: [],
is_admin: false,