From b65aafe1e3ef97812686bd7fd6dabd45cebb0649 Mon Sep 17 00:00:00 2001 From: FloatingGhost Date: Wed, 2 Aug 2023 12:05:30 +0100 Subject: [PATCH] Fix tests breaking on config changes --- test/pleroma/web/metadata/utils_test.exs | 14 +------------- .../web/web_finger/web_finger_controller_test.exs | 1 - 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/test/pleroma/web/metadata/utils_test.exs b/test/pleroma/web/metadata/utils_test.exs index 15aa1243b..32bc86942 100644 --- a/test/pleroma/web/metadata/utils_test.exs +++ b/test/pleroma/web/metadata/utils_test.exs @@ -80,24 +80,12 @@ defmodule Pleroma.Web.Metadata.UtilsTest do describe "user_name_string/1" do test "it uses the Endpoint by default" do - Pleroma.Web.Endpoint.config_change( - [{Pleroma.Web.Endpoint, url: [host: "sub.example.com"]}], - [] - ) - user = insert(:user) - assert Utils.user_name_string(user) == "#{user.name} (@#{user.nickname}@sub.example.com)" + assert Utils.user_name_string(user) == "#{user.name} (@#{user.nickname}@localhost)" end test "it uses any custom WebFinger domain" do - Pleroma.Web.Endpoint.config_change( - [{Pleroma.Web.Endpoint, url: [host: "sub.example.com"]}], - [] - ) - - clear_config([Pleroma.Web.Endpoint, :url, :host], "sub.example.com") - clear_config([Pleroma.Web.WebFinger, :domain], "example.com") user = insert(:user) diff --git a/test/pleroma/web/web_finger/web_finger_controller_test.exs b/test/pleroma/web/web_finger/web_finger_controller_test.exs index 47e72662c..29cb6e01b 100644 --- a/test/pleroma/web/web_finger/web_finger_controller_test.exs +++ b/test/pleroma/web/web_finger/web_finger_controller_test.exs @@ -8,7 +8,6 @@ defmodule Pleroma.Web.WebFinger.WebFingerControllerTest do import ExUnit.CaptureLog import Pleroma.Factory import Tesla.Mock - alias Pleroma.Web.Metadata.Utils setup do mock(fn env -> apply(HttpRequestMock, :request, [env]) end)