Packages

Phoenix framework project generator. Provides a `mix phx.new` task to bootstrap a new Elixir application with Phoenix and Hotwire dependencies.

Current section

Files

Jump to
phx_new_hotwire templates phx_test controllers error_json_test.exs
Raw

templates/phx_test/controllers/error_json_test.exs

defmodule <%= @web_namespace %>.ErrorJSONTest do
use <%= @web_namespace %>.ConnCase, async: true
test "renders 404" do
assert <%= @web_namespace %>.ErrorJSON.render("404.json", %{}) == %{errors: %{detail: "Not Found"}}
end
test "renders 500" do
assert <%= @web_namespace %>.ErrorJSON.render("500.json", %{}) ==
%{errors: %{detail: "Internal Server Error"}}
end
end