defmodule ToweropsWeb.ErrorJSONTest do use ToweropsWeb.ConnCase, async: true test "renders 404" do assert ToweropsWeb.ErrorJSON.render("404.json", %{}) == %{errors: %{detail: "Not Found"}} end test "renders 500" do result = ToweropsWeb.ErrorJSON.render("500.json", %{}) assert result.errors.detail == "An unexpected error occurred. Please contact support if this persists." assert Map.has_key?(result.errors, :request_id) end end