diff options
| author | Haelwenn <contact+git.pleroma.social@hacktivis.me> | 2020-07-10 08:55:15 +0000 |
|---|---|---|
| committer | Haelwenn <contact+git.pleroma.social@hacktivis.me> | 2020-07-10 08:55:15 +0000 |
| commit | 4ac6e6283f6e090588ad56066b1e552b895f3a24 (patch) | |
| tree | c6536c1ab63ea26913b649cc3f64cea438b62f38 /test/web/mastodon_api/views | |
| parent | c2be0da79fcc95399647b292e0b9a4119d3dcdf1 (diff) | |
| parent | 5ea638757210c34b40fb568e537082b78f4118a6 (diff) | |
| download | pleroma-4ac6e6283f6e090588ad56066b1e552b895f3a24.tar.gz pleroma-4ac6e6283f6e090588ad56066b1e552b895f3a24.zip | |
Merge branch 'develop' into 'admin-api-user-credentials-for-remote-users-fix'
# Conflicts:
# CHANGELOG.md
Diffstat (limited to 'test/web/mastodon_api/views')
| -rw-r--r-- | test/web/mastodon_api/views/account_view_test.exs | 24 |
1 files changed, 24 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 3e2e780e3..f5bfc9c67 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"}] @@ -75,6 +78,8 @@ 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", confirmation_pending: false, tags: [], is_admin: false, @@ -92,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) @@ -152,6 +174,8 @@ 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", confirmation_pending: false, tags: [], is_admin: false, |
