diff options
| author | lain <lain@soykaf.club> | 2019-05-17 12:26:59 +0200 |
|---|---|---|
| committer | lain <lain@soykaf.club> | 2019-05-17 12:26:59 +0200 |
| commit | 412a3d8a0f74ee3a46f9ba98d906c65c6c1c4da8 (patch) | |
| tree | d7dc5c61e4b3a01b21e33ccbea3aa4bfffc051aa /test/web/views | |
| parent | f1e67bdc312ba16a37916024244d6cb9d4417c9e (diff) | |
| parent | e5b34f5e0544371603bc2b570c26ede3182c2f8b (diff) | |
| download | pleroma-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.exs | 19 |
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 |
