summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHaelwenn (lanodan) Monnier <contact@hacktivis.me>2020-07-08 05:56:24 +0200
committerHaelwenn (lanodan) Monnier <contact@hacktivis.me>2020-07-08 06:28:40 +0200
commit312fc55f14e1b7f88ec43b72c577bf5df595beac (patch)
tree78dcafbc755dfabea5fd201f5e46a887c0db0b7e /test
parent8c9df2d2e6a5a3639f6b411cd3e9b57248a0650c (diff)
downloadpleroma-312fc55f14e1b7f88ec43b72c577bf5df595beac.tar.gz
pleroma-312fc55f14e1b7f88ec43b72c577bf5df595beac.zip
Add [:instances_favicons, :enabled] setting, defaults to false
Diffstat (limited to 'test')
-rw-r--r--test/web/mastodon_api/views/account_view_test.exs20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/web/mastodon_api/views/account_view_test.exs b/test/web/mastodon_api/views/account_view_test.exs
index c4341cb28..ac6d50e3a 100644
--- a/test/web/mastodon_api/views/account_view_test.exs
+++ b/test/web/mastodon_api/views/account_view_test.exs
@@ -5,6 +5,7 @@
defmodule Pleroma.Web.MastodonAPI.AccountViewTest do
use Pleroma.DataCase
+ alias Pleroma.Config
alias Pleroma.User
alias Pleroma.UserRelationship
alias Pleroma.Web.CommonAPI
@@ -18,6 +19,8 @@ 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"}]
@@ -94,6 +97,23 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do
assert expected == AccountView.render("show.json", %{user: user})
end
+ test "Favicon is nil when :instances_favicons is disabled" do
+ user = insert(:user)
+
+ Config.put([:instances_favicons, :enabled], true)
+
+ assert %{
+ pleroma: %{
+ favicon:
+ "https://shitposter.club/plugins/Qvitter/img/gnusocial-favicons/favicon-16x16.png"
+ }
+ } = AccountView.render("show.json", %{user: user})
+
+ Config.put([:instances_favicons, :enabled], false)
+
+ assert %{pleroma: %{favicon: nil}} = AccountView.render("show.json", %{user: user})
+ end
+
test "Represent the user account for the account owner" do
user = insert(:user)