X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=test%2Fweb%2Fweb_finger%2Fweb_finger_controller_test.exs;h=0023f1e810e4cee2bed55d0cc49f73b51fe9f334;hb=a9938611f7f3771dc9cf10fb0d0d9f78c4e2f80d;hp=e23086b2aeb7edf88402a360e220bf81beb5a7e3;hpb=cc28184854970c6f8406fc588686e9b275f06ee4;p=akkoma
diff --git a/test/web/web_finger/web_finger_controller_test.exs b/test/web/web_finger/web_finger_controller_test.exs
index e23086b2a..0023f1e81 100644
--- a/test/web/web_finger/web_finger_controller_test.exs
+++ b/test/web/web_finger/web_finger_controller_test.exs
@@ -1,10 +1,11 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2018 Pleroma Authors
+# Copyright © 2017-2020 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.WebFinger.WebFingerControllerTest do
use Pleroma.Web.ConnCase
+ import ExUnit.CaptureLog
import Pleroma.Factory
import Tesla.Mock
@@ -13,9 +14,7 @@ defmodule Pleroma.Web.WebFinger.WebFingerControllerTest do
:ok
end
- clear_config_all([:instance, :federating]) do
- Pleroma.Config.put([:instance, :federating], true)
- end
+ setup_all do: clear_config([:instance, :federating], true)
test "GET host-meta" do
response =
@@ -75,11 +74,13 @@ defmodule Pleroma.Web.WebFinger.WebFingerControllerTest do
test "Sends a 404 when invalid format" do
user = insert(:user)
- assert_raise Phoenix.NotAcceptableError, fn ->
- build_conn()
- |> put_req_header("accept", "text/html")
- |> get("/.well-known/webfinger?resource=acct:#{user.nickname}@localhost")
- end
+ assert capture_log(fn ->
+ assert_raise Phoenix.NotAcceptableError, fn ->
+ build_conn()
+ |> put_req_header("accept", "text/html")
+ |> get("/.well-known/webfinger?resource=acct:#{user.nickname}@localhost")
+ end
+ end) =~ "no supported media type in accept header"
end
test "Sends a 400 when resource param is missing" do