Fix tests breaking on config changes

This commit is contained in:
FloatingGhost 2023-08-02 12:05:30 +01:00
parent c38f1aefb1
commit b65aafe1e3
2 changed files with 1 additions and 14 deletions

View file

@ -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)

View file

@ -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)