Compare commits
No commits in common. "9d72fb293b19d1266ef08e52c10d22022fc2a812" and "39be25bf3cdb857a5e1ab87ba2bae96372bef375" have entirely different histories.
9d72fb293b
...
39be25bf3c
2 changed files with 2 additions and 84 deletions
|
@ -65,8 +65,8 @@ defmodule NullaWeb.ActorControllerTest do
|
|||
assert is_list(response["tag"])
|
||||
assert is_list(response["attachment"])
|
||||
assert is_map(response["endpoints"])
|
||||
assert is_map(response["icon"]) or is_nil(response["icon"])
|
||||
assert is_map(response["image"]) or is_nil(response["image"])
|
||||
assert is_map(response["icon"])
|
||||
assert is_map(response["image"])
|
||||
assert is_binary(response["vcard:bday"]) or is_nil(response["vcard:bday"])
|
||||
assert is_binary(response["vcard:Address"]) or is_nil(response["vcard:Address"])
|
||||
end
|
||||
|
|
|
@ -1,82 +0,0 @@
|
|||
defmodule NullaWeb.WebfingerControllerTest do
|
||||
use NullaWeb.ConnCase
|
||||
alias Nulla.Models.Actor
|
||||
|
||||
setup do
|
||||
Actor.create_actor(%{
|
||||
domain: "localhost",
|
||||
ap_id: "http://localhost/users/test",
|
||||
type: "Person",
|
||||
following: "http://localhost/users/test/following",
|
||||
followers: "http://localhost/users/test/followers",
|
||||
inbox: "http://localhost/users/test/inbox",
|
||||
outbox: "http://localhost/users/test/outbox",
|
||||
featured: "http://localhost/users/test/collections/featured",
|
||||
featuredTags: "http://localhost/users/test/collections/tags",
|
||||
preferredUsername: "test",
|
||||
name: "Test",
|
||||
summary: "Test User",
|
||||
url: "http://localhost/@test",
|
||||
manuallyApprovesFollowers: false,
|
||||
discoverable: true,
|
||||
indexable: true,
|
||||
published: DateTime.utc_now(),
|
||||
memorial: false,
|
||||
publicKey:
|
||||
Jason.OrderedObject.new(
|
||||
id: "http://localhost/users/test#main-key",
|
||||
owner: "http://localhost/users/test",
|
||||
publicKeyPem: "PUBLIC KEY"
|
||||
),
|
||||
endpoints: Jason.OrderedObject.new(sharedInbox: "http://localhost/inbox")
|
||||
})
|
||||
|
||||
:ok
|
||||
end
|
||||
|
||||
describe "GET /.well-known/webfinger" do
|
||||
test "returns 400 without parameters", %{conn: conn} do
|
||||
conn =
|
||||
conn
|
||||
|> get(~p"/.well-known/webfinger")
|
||||
|
||||
assert conn.status == 400
|
||||
end
|
||||
|
||||
test "returns 400 without :acct", %{conn: conn} do
|
||||
conn =
|
||||
conn
|
||||
|> get(~p"/.well-known/webfinger?resource=test@localhost")
|
||||
|
||||
assert conn.status == 400
|
||||
end
|
||||
|
||||
test "returns 400 without domain", %{conn: conn} do
|
||||
conn =
|
||||
conn
|
||||
|> get(~p"/.well-known/webfinger?resource=acct:test")
|
||||
|
||||
assert conn.status == 400
|
||||
end
|
||||
|
||||
test "returns 404 with invalid domain", %{conn: conn} do
|
||||
conn =
|
||||
conn
|
||||
|> get(~p"/.well-known/webfinger?resource=acct:test@example")
|
||||
|
||||
assert conn.status == 404
|
||||
end
|
||||
|
||||
test "returns Webfinger", %{conn: conn} do
|
||||
conn =
|
||||
conn
|
||||
|> get(~p"/.well-known/webfinger?resource=acct:test@localhost")
|
||||
|
||||
assert response = json_response(conn, 200)
|
||||
|
||||
assert is_binary(response["subject"])
|
||||
assert is_list(response["aliases"])
|
||||
assert is_list(response["links"])
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue