memEx/test/memex_web/views/error_view_test.exs

23 lines
578 B
Elixir
Raw Normal View History

2023-02-26 00:47:51 -05:00
defmodule MemexWeb.ErrorViewTest do
2022-02-25 21:53:15 -05:00
@moduledoc """
Tests the error view
"""
2023-02-26 00:47:51 -05:00
use MemexWeb.ConnCase, async: true
import MemexWeb.Gettext
2021-03-11 21:12:55 -05:00
# Bring render/3 and render_to_string/3 for testing custom views
import Phoenix.View
2023-02-04 17:28:53 -05:00
@moduletag :error_view_test
2021-03-11 21:12:55 -05:00
test "renders 404.html" do
2023-02-26 00:47:51 -05:00
assert render_to_string(MemexWeb.ErrorView, "404.html", []) =~
2022-02-25 21:53:15 -05:00
dgettext("errors", "Not found")
2021-03-11 21:12:55 -05:00
end
test "renders 500.html" do
2023-02-26 00:47:51 -05:00
assert render_to_string(MemexWeb.ErrorView, "500.html", []) =~
2022-02-25 21:53:15 -05:00
dgettext("errors", "Internal Server Error")
2021-03-11 21:12:55 -05:00
end
end