summaryrefslogtreecommitdiff
path: root/test/web/views
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2019-05-17 12:26:59 +0200
committerlain <lain@soykaf.club>2019-05-17 12:26:59 +0200
commit412a3d8a0f74ee3a46f9ba98d906c65c6c1c4da8 (patch)
treed7dc5c61e4b3a01b21e33ccbea3aa4bfffc051aa /test/web/views
parentf1e67bdc312ba16a37916024244d6cb9d4417c9e (diff)
parente5b34f5e0544371603bc2b570c26ede3182c2f8b (diff)
downloadpleroma-412a3d8a0f74ee3a46f9ba98d906c65c6c1c4da8.tar.gz
pleroma-412a3d8a0f74ee3a46f9ba98d906c65c6c1c4da8.zip
Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into rum-index
Diffstat (limited to 'test/web/views')
-rw-r--r--test/web/views/error_view_test.exs19
1 files changed, 13 insertions, 6 deletions
diff --git a/test/web/views/error_view_test.exs b/test/web/views/error_view_test.exs
index d529fd2c3..3857d585f 100644
--- a/test/web/views/error_view_test.exs
+++ b/test/web/views/error_view_test.exs
@@ -4,6 +4,7 @@
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