forked from AkkomaGang/akkoma
Add a unit test for custom WebFinger domain
This commit is contained in:
parent
7ff9c356f4
commit
1377ec33fe
1 changed files with 3 additions and 0 deletions
|
@ -8,6 +8,7 @@ defmodule Pleroma.Web.WebFinger.WebFingerControllerTest do
|
||||||
import ExUnit.CaptureLog
|
import ExUnit.CaptureLog
|
||||||
import Pleroma.Factory
|
import Pleroma.Factory
|
||||||
import Tesla.Mock
|
import Tesla.Mock
|
||||||
|
alias Pleroma.Web.Metadata.Utils
|
||||||
|
|
||||||
setup do
|
setup do
|
||||||
mock(fn env -> apply(HttpRequestMock, :request, [env]) end)
|
mock(fn env -> apply(HttpRequestMock, :request, [env]) end)
|
||||||
|
@ -60,6 +61,8 @@ test "reach user on tld, while pleroma is runned on subdomain" do
|
||||||
|
|
||||||
user = insert(:user, ap_id: "https://sub.example.com/users/bobby", nickname: "bobby")
|
user = insert(:user, ap_id: "https://sub.example.com/users/bobby", nickname: "bobby")
|
||||||
|
|
||||||
|
assert Utils.user_name_string(user) == "#{user.name} (@bobby@example.com)"
|
||||||
|
|
||||||
response =
|
response =
|
||||||
build_conn()
|
build_conn()
|
||||||
|> put_req_header("accept", "application/jrd+json")
|
|> put_req_header("accept", "application/jrd+json")
|
||||||
|
|
Loading…
Reference in a new issue