defmodule SimpleshopThemeWeb.ErrorHTMLTest do
  use SimpleshopThemeWeb.ConnCase, async: true

  # Bring render_to_string/4 for testing custom views
  import Phoenix.Template, only: [render_to_string: 4]

  test "renders 404.html with themed page" do
    html = render_to_string(SimpleshopThemeWeb.ErrorHTML, "404", "html", [])
    assert html =~ "404"
    assert html =~ "Page Not Found"
    assert html =~ "shop-root"
  end

  test "renders 500.html with themed page" do
    html = render_to_string(SimpleshopThemeWeb.ErrorHTML, "500", "html", [])
    assert html =~ "500"
    assert html =~ "Server Error"
    assert html =~ "shop-root"
  end
end
