projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
No need to filter out Mix.env() from the API routes.
[akkoma]
/
test
/
pleroma
/
web
/
web_finger
/
web_finger_controller_test.exs
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 0023f1e810e4cee2bed55d0cc49f73b51fe9f334..7059850bd795689a247d298b4c08d5d5eda9d214 100644
(file)
--- a/
test/pleroma/web/web_finger/web_finger_controller_test.exs
+++ b/
test/pleroma/web/web_finger/web_finger_controller_test.exs
@@
-1,5
+1,5
@@
# Pleroma: A lightweight social networking server
# Pleroma: A lightweight social networking server
-# Copyright © 2017-202
0
Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-202
1
Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.WebFinger.WebFingerControllerTest do
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.WebFinger.WebFingerControllerTest do
@@
-30,14
+30,24
@@
defmodule Pleroma.Web.WebFinger.WebFingerControllerTest do
end
test "Webfinger JRD" do
end
test "Webfinger JRD" do
- user = insert(:user)
+ user =
+ insert(:user,
+ ap_id: "https://hyrule.world/users/zelda",
+ also_known_as: ["https://mushroom.kingdom/users/toad"]
+ )
response =
build_conn()
|> put_req_header("accept", "application/jrd+json")
|> get("/.well-known/webfinger?resource=acct:#{user.nickname}@localhost")
response =
build_conn()
|> put_req_header("accept", "application/jrd+json")
|> get("/.well-known/webfinger?resource=acct:#{user.nickname}@localhost")
+ |> json_response(200)
+
+ assert response["subject"] == "acct:#{user.nickname}@localhost"
- assert json_response(response, 200)["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
end
test "it returns 404 when user isn't found (JSON)" do
@@
-51,14
+61,20
@@
defmodule Pleroma.Web.WebFinger.WebFingerControllerTest do
end
test "Webfinger XML" do
end
test "Webfinger XML" do
- user = insert(:user)
+ user =
+ insert(:user,
+ ap_id: "https://hyrule.world/users/zelda",
+ also_known_as: ["https://mushroom.kingdom/users/toad"]
+ )
response =
build_conn()
|> put_req_header("accept", "application/xrd+xml")
|> get("/.well-known/webfinger?resource=acct:#{user.nickname}@localhost")
response =
build_conn()
|> put_req_header("accept", "application/xrd+xml")
|> get("/.well-known/webfinger?resource=acct:#{user.nickname}@localhost")
+ |> response(200)
- assert response(response, 200)
+ assert response =~ "<Alias>https://hyrule.world/users/zelda</Alias>"
+ assert response =~ "<Alias>https://mushroom.kingdom/users/toad</Alias>"
end
test "it returns 404 when user isn't found (XML)" do
end
test "it returns 404 when user isn't found (XML)" do