A few more tests

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2018-11-28 10:49:16 +01:00
parent 3ddd5ee485
commit c9f58ea899
3 changed files with 15 additions and 3 deletions

View File

@@ -36,4 +36,10 @@ defmodule MobilizonWeb.NodeInfoControllerTest do
"version" => "2.0"
}
end
test "Get node info with non supported version (1.0)", %{conn: conn} do
conn = get(conn, node_info_path(conn, :nodeinfo, "1.0"))
assert json_response(conn, 404) == %{"error" => "Nodeinfo schema version not handled"}
end
end

View File

@@ -21,6 +21,11 @@ defmodule MobilizonWeb.WebFingerTest do
assert json_response(conn, 200) == WebFinger.represent_actor(actor)
end
test "GET /.well-known/webfinger with non existent actor", %{conn: conn} do
conn = get(conn, "/.well-known/webfinger?resource=acct:notme@localhost:4001")
assert response(conn, 404) == "Couldn't find user"
end
test "GET /.well-known/webfinger with no query", %{conn: conn} do
conn = get(conn, "/.well-known/webfinger")
assert response(conn, 400) == "No query provided"