1
0
mirror of https://github.com/mgerb/classic-wow-forums synced 2026-01-11 17:42:48 +00:00
Files
classic-wow-forums/test/myapp_web/views/error_view_test.exs
2017-12-31 20:19:44 -06:00

22 lines
609 B
Elixir

defmodule MyAppWeb.ErrorViewTest do
use MyAppWeb.ConnCase, async: true
# Bring render/3 and render_to_string/3 for testing custom views
import Phoenix.View
test "renders 404.json" do
assert render(MyAppWeb.ErrorView, "404.json", []) ==
%{errors: %{detail: "Page not found"}}
end
test "render 500.json" do
assert render(MyAppWeb.ErrorView, "500.json", []) ==
%{errors: %{detail: "Internal server error"}}
end
test "render any other" do
assert render(MyAppWeb.ErrorView, "505.json", []) ==
%{errors: %{detail: "Internal server error"}}
end
end