19 lines
615 B
Elixir
19 lines
615 B
Elixir
defmodule ToweropsWeb.ErrorHTMLTest do
|
|
use ToweropsWeb.ConnCase, async: true
|
|
|
|
# Bring render_to_string/4 for testing custom views
|
|
import Phoenix.Template, only: [render_to_string: 4]
|
|
|
|
test "renders 404.html" do
|
|
html = render_to_string(ToweropsWeb.ErrorHTML, "404", "html", [])
|
|
assert html =~ "404"
|
|
assert html =~ "Oops, a squirrel must have eaten that wire!"
|
|
assert html =~ "/images/squirrel.jpg"
|
|
end
|
|
|
|
test "renders 500.html" do
|
|
html = render_to_string(ToweropsWeb.ErrorHTML, "500", "html", [])
|
|
assert html =~ "500"
|
|
assert html =~ "Something went wrong on our end"
|
|
end
|
|
end
|