diff --git a/test/towerops_web/controllers/error_html_test.exs b/test/towerops_web/controllers/error_html_test.exs index 11567612..1579cd49 100644 --- a/test/towerops_web/controllers/error_html_test.exs +++ b/test/towerops_web/controllers/error_html_test.exs @@ -16,4 +16,16 @@ defmodule ToweropsWeb.ErrorHTMLTest do assert html =~ "500" assert html =~ "Something went wrong on our end" end + + test "renders fallback status message for unknown templates" do + # Test the fallback render/2 function for error codes without custom templates + result = ToweropsWeb.ErrorHTML.render("503.html", %{}) + assert result == "Service Unavailable" + + result = ToweropsWeb.ErrorHTML.render("401.html", %{}) + assert result == "Unauthorized" + + result = ToweropsWeb.ErrorHTML.render("403.html", %{}) + assert result == "Forbidden" + end end