Current section
Files
Jump to
Current section
Files
templates/starter_test/views/error_view_test.exs
defmodule <%= @arke_ns %>.ErrorViewTest do
use <%= @arke_ns %>.ConnCase, async: true
# Bring render_to_string/4 for testing custom views
import Phoenix.View
test "renders 404.json" do
assert render_to_string(<%= @arke_ns %>.ErrorView, "404.json", []) == %{errors: %{detail: "Not Found"}}
end
test "renders 500.json" do
assert render_to_string(<%= @arke_ns %>.ErrorView, "500.json", []) ==
%{errors: %{detail: "Internal Server Error"}}
end
end