improve tests
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2023-03-22 22:08:37 -04:00
parent 64320dbdae
commit 5a41d8b3e7
24 changed files with 369 additions and 470 deletions

View File

@ -4,19 +4,16 @@ defmodule MemexWeb.ErrorViewTest do
"""
use MemexWeb.ConnCase, async: true
import MemexWeb.Gettext
# Bring render/3 and render_to_string/3 for testing custom views
import Phoenix.View
@moduletag :error_view_test
test "renders 404.html" do
assert render_to_string(MemexWeb.ErrorView, "404.html", []) =~
dgettext("errors", "not found")
assert render_to_string(MemexWeb.ErrorView, "404.html", []) =~ "not found"
end
test "renders 500.html" do
assert render_to_string(MemexWeb.ErrorView, "500.html", []) =~
dgettext("errors", "internal server error")
assert render_to_string(MemexWeb.ErrorView, "500.html", []) =~ "internal server error"
end
end