mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-22 14:45:16 +00:00
Fix tests breaking on config changes
This commit is contained in:
parent
c38f1aefb1
commit
b65aafe1e3
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue