2026-02-18 21:23:15 +00:00
|
|
|
defmodule BerrypodWeb.ErrorHTMLTest do
|
|
|
|
|
use BerrypodWeb.ConnCase, async: true
|
2025-12-30 12:26:26 +00:00
|
|
|
|
|
|
|
|
# Bring render_to_string/4 for testing custom views
|
|
|
|
|
import Phoenix.Template, only: [render_to_string: 4]
|
|
|
|
|
|
2026-01-17 22:29:45 +00:00
|
|
|
test "renders 404.html with themed page" do
|
2026-02-18 21:23:15 +00:00
|
|
|
html = render_to_string(BerrypodWeb.ErrorHTML, "404", "html", [])
|
2026-01-17 22:29:45 +00:00
|
|
|
assert html =~ "404"
|
|
|
|
|
assert html =~ "Page Not Found"
|
|
|
|
|
assert html =~ "shop-root"
|
2025-12-30 12:26:26 +00:00
|
|
|
end
|
|
|
|
|
|
2026-01-17 22:29:45 +00:00
|
|
|
test "renders 500.html with themed page" do
|
2026-02-18 21:23:15 +00:00
|
|
|
html = render_to_string(BerrypodWeb.ErrorHTML, "500", "html", [])
|
2026-01-17 22:29:45 +00:00
|
|
|
assert html =~ "500"
|
|
|
|
|
assert html =~ "Server Error"
|
|
|
|
|
assert html =~ "shop-root"
|
2025-12-30 12:26:26 +00:00
|
|
|
end
|
|
|
|
|
end
|