2021-03-11 21:12:55 -05:00
|
|
|
defmodule CanneryWeb.ErrorViewTest do
|
2022-02-17 20:46:17 -05:00
|
|
|
@moduledoc """
|
|
|
|
Tests the error view
|
|
|
|
"""
|
|
|
|
|
2021-03-11 21:12:55 -05:00
|
|
|
use CanneryWeb.ConnCase, async: true
|
|
|
|
# Bring render/3 and render_to_string/3 for testing custom views
|
|
|
|
import Phoenix.View
|
|
|
|
|
2022-03-28 23:05:12 -04:00
|
|
|
@moduletag :error_view_test
|
|
|
|
|
2021-03-11 21:12:55 -05:00
|
|
|
test "renders 404.html" do
|
2023-03-28 21:57:29 -04:00
|
|
|
assert render_to_string(CanneryWeb.ErrorView, "404.html", []) =~ "Not found"
|
2021-03-11 21:12:55 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
test "renders 500.html" do
|
2023-03-28 21:57:29 -04:00
|
|
|
assert render_to_string(CanneryWeb.ErrorView, "500.html", []) =~ "Internal Server Error"
|
2021-03-11 21:12:55 -05:00
|
|
|
end
|
|
|
|
end
|