X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=test%2Fweb%2Fweb_finger%2Fweb_finger_controller_test.exs;h=0023f1e810e4cee2bed55d0cc49f73b51fe9f334;hb=5c4ff5c73ce41f252e99a3c5c445efcecaa43dfe;hp=7d861cbf5fac3de8cdc2a45ecbe2d0e341ce8709;hpb=7286cdff7a1487e79ee48b572fe6888542b1dfbd;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 7d861cbf5..0023f1e81 100644
--- a/test/web/web_finger/web_finger_controller_test.exs
+++ b/test/web/web_finger/web_finger_controller_test.exs
@@ -1,24 +1,21 @@
# 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
setup do
mock(fn env -> apply(HttpRequestMock, :request, [env]) end)
-
- config_path = [:instance, :federating]
- initial_setting = Pleroma.Config.get(config_path)
-
- Pleroma.Config.put(config_path, true)
- on_exit(fn -> Pleroma.Config.put(config_path, initial_setting) end)
:ok
end
+ setup_all do: clear_config([:instance, :federating], true)
+
test "GET host-meta" do
response =
build_conn()
@@ -77,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