X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=test%2Fweb%2Fviews%2Ferror_view_test.exs;h=8dbbd18b490eba2dc0abcb2ea98d0dd36a390929;hb=fd04137e182468d519db078d1d309043946652ca;hp=d529fd2c358485edca29fceaed3a18510e1a0010;hpb=627e5a0a4992cc19fc65a7e93a09c470c8e2bf33;p=akkoma
diff --git a/test/web/views/error_view_test.exs b/test/web/views/error_view_test.exs
index d529fd2c3..8dbbd18b4 100644
--- a/test/web/views/error_view_test.exs
+++ b/test/web/views/error_view_test.exs
@@ -1,9 +1,10 @@
# 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.ErrorViewTest do
use Pleroma.Web.ConnCase, async: true
+ import ExUnit.CaptureLog
# Bring render/3 and render_to_string/3 for testing custom views
import Phoenix.View
@@ -13,17 +14,23 @@ defmodule Pleroma.Web.ErrorViewTest do
end
test "render 500.json" do
- assert render(Pleroma.Web.ErrorView, "500.json", []) ==
- %{errors: %{detail: "Internal server error", reason: "nil"}}
+ assert capture_log(fn ->
+ assert render(Pleroma.Web.ErrorView, "500.json", []) ==
+ %{errors: %{detail: "Internal server error", reason: "nil"}}
+ end) =~ "[error] Internal server error: nil"
end
test "render any other" do
- assert render(Pleroma.Web.ErrorView, "505.json", []) ==
- %{errors: %{detail: "Internal server error", reason: "nil"}}
+ assert capture_log(fn ->
+ assert render(Pleroma.Web.ErrorView, "505.json", []) ==
+ %{errors: %{detail: "Internal server error", reason: "nil"}}
+ end) =~ "[error] Internal server error: nil"
end
test "render 500.json with reason" do
- assert render(Pleroma.Web.ErrorView, "500.json", reason: "test reason") ==
- %{errors: %{detail: "Internal server error", reason: "\"test reason\""}}
+ assert capture_log(fn ->
+ assert render(Pleroma.Web.ErrorView, "500.json", reason: "test reason") ==
+ %{errors: %{detail: "Internal server error", reason: "\"test reason\""}}
+ end) =~ "[error] Internal server error: \"test reason\""
end
end