Add account aliases

This commit is contained in:
Alex Gleason 2020-07-16 22:19:17 -05:00
commit d0eb43b58b
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7
13 changed files with 220 additions and 4 deletions

View file

@ -30,14 +30,24 @@ defmodule Pleroma.Web.WebFinger.WebFingerControllerTest do
end
test "Webfinger JRD" do
user = insert(:user)
user =
insert(:user,
ap_id: "https://hyrule.world/users/zelda",
ap_aliases: ["https://mushroom.kingdom/users/toad"]
)
response =
build_conn()
|> put_req_header("accept", "application/jrd+json")
|> get("/.well-known/webfinger?resource=acct:#{user.nickname}@localhost")
|> json_response(200)
assert json_response(response, 200)["subject"] == "acct:#{user.nickname}@localhost"
assert response["subject"] == "acct:#{user.nickname}@localhost"
assert response["aliases"] == [
"https://hyrule.world/users/zelda",
"https://mushroom.kingdom/users/toad"
]
end
test "it returns 404 when user isn't found (JSON)" do