2021-03-11 21:12:55 -05:00
|
|
|
defmodule CanneryWeb.ErrorViewTest do
|
|
|
|
use CanneryWeb.ConnCase, async: true
|
2022-02-09 00:13:01 -05:00
|
|
|
import CanneryWeb.Gettext
|
2021-03-11 21:12:55 -05:00
|
|
|
|
|
|
|
# Bring render/3 and render_to_string/3 for testing custom views
|
|
|
|
import Phoenix.View
|
|
|
|
|
|
|
|
test "renders 404.html" do
|
2022-02-09 00:13:01 -05:00
|
|
|
assert render_to_string(CanneryWeb.ErrorView, "404.html", []) ==
|
|
|
|
dgettext("errors", "Not Found")
|
2021-03-11 21:12:55 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
test "renders 500.html" do
|
2022-02-09 00:13:01 -05:00
|
|
|
assert render_to_string(CanneryWeb.ErrorView, "500.html", []) ==
|
|
|
|
dgettext("errors", "Internal Server Error")
|
2021-03-11 21:12:55 -05:00
|
|
|
end
|
|
|
|
end
|