summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLain Soykaf <lain@lain.com>2023-12-11 10:33:33 +0400
committerLain Soykaf <lain@lain.com>2023-12-11 10:33:33 +0400
commite8e74146e8114a70cb02aef54b04caf5f0f9ae8d (patch)
tree8159653fc174e57d2da5d881993ccbf9f1c24bc7
parent50c31cb31ba45bbbb261d02a57e3f69105aac8df (diff)
downloadpleroma-e8e74146e8114a70cb02aef54b04caf5f0f9ae8d.tar.gz
pleroma-e8e74146e8114a70cb02aef54b04caf5f0f9ae8d.zip
MastodonAPI.AccountViewTest: Fix tests
-rw-r--r--test/pleroma/web/mastodon_api/views/account_view_test.exs9
1 files changed, 7 insertions, 2 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 d5b8ad8b0..8dcdaf447 100644
--- a/test/pleroma/web/mastodon_api/views/account_view_test.exs
+++ b/test/pleroma/web/mastodon_api/views/account_view_test.exs
@@ -5,11 +5,13 @@
defmodule Pleroma.Web.MastodonAPI.AccountViewTest do
use Pleroma.DataCase, async: false
+ alias Pleroma.UnstubbedConfigMock, as: ConfigMock
alias Pleroma.User
alias Pleroma.UserRelationship
alias Pleroma.Web.CommonAPI
alias Pleroma.Web.MastodonAPI.AccountView
+ import Mox
import Pleroma.Factory
import Tesla.Mock
@@ -753,6 +755,9 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do
clear_config([:media_proxy, :enabled], true)
clear_config([:media_preview_proxy, :enabled])
+ ConfigMock
+ |> stub_with(Pleroma.Test.StaticConfig)
+
user =
insert(:user,
avatar: %{"url" => [%{"href" => "https://evil.website/avatar.png"}]},
@@ -760,7 +765,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do
emoji: %{"joker_smile" => "https://evil.website/society.png"}
)
- with media_preview_enabled <- [false, true] do
+ Enum.each([true, false], fn media_preview_enabled ->
clear_config([:media_preview_proxy, :enabled], media_preview_enabled)
AccountView.render("show.json", %{user: user, skip_visibility_check: true})
@@ -778,7 +783,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do
true
end)
|> assert()
- end
+ end)
end
test "renders mute expiration date" do