Skip to content
Snippets Groups Projects
Verified Commit 5af91020 authored by Haelwenn's avatar Haelwenn
Browse files

Web.WebFinger.WebFingerControllerTest: test against XML and JRD webfinger endpoints

parent ff7ce9a9
Branches fix-streaming-reblog
No related tags found
No related merge requests found
defmodule Pleroma.Web.WebFinger.WebFingerControllerTest do
use Pleroma.Web.ConnCase
alias Pleroma.User
alias Pleroma.Web.WebFinger.WebFingerController
import Pleroma.Factory
import ExUnit.CaptureLog
import Tesla.Mock
setup do
mock(fn env -> apply(HttpRequestMock, :request, [env]) end)
:ok
end
test "Webfinger JRD" do
user = insert(:user)
response =
build_conn()
|> put_req_header("accept", "application/jrd+json")
|> get("/.well-known/webfinger?resource=acct:#{user.nickname}@localhost")
assert json_response(response, 200)["subject"] == "acct:#{user.nickname}@localhost"
end
test "Webfinger XML" do
user = insert(:user)
response =
build_conn()
|> put_req_header("accept", "application/jrd+json")
|> get("/.well-known/webfinger?resource=acct:#{user.nickname}@localhost")
assert response(response, 200)
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment