diff --git a/test/nulla_web/controllers/actor_controller_test.exs b/test/nulla_web/controllers/actor_controller_test.exs index db916a2..01cc610 100644 --- a/test/nulla_web/controllers/actor_controller_test.exs +++ b/test/nulla_web/controllers/actor_controller_test.exs @@ -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 diff --git a/test/nulla_web/controllers/webfinger_controller_test.exs b/test/nulla_web/controllers/webfinger_controller_test.exs deleted file mode 100644 index 041ec5a..0000000 --- a/test/nulla_web/controllers/webfinger_controller_test.exs +++ /dev/null @@ -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