aboutsummaryrefslogtreecommitdiff
path: root/test/views/error_view_test.exs
diff options
context:
space:
mode:
Diffstat (limited to 'test/views/error_view_test.exs')
-rw-r--r--test/views/error_view_test.exs21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/views/error_view_test.exs b/test/views/error_view_test.exs
new file mode 100644
index 0000000..cd5390a
--- /dev/null
+++ b/test/views/error_view_test.exs
@@ -0,0 +1,21 @@
+defmodule TheTranscriberBackend.ErrorViewTest do
+ use TheTranscriberBackend.ConnCase, async: true
+
+ # Bring render/3 and render_to_string/3 for testing custom views
+ import Phoenix.View
+
+ test "renders 404.html" do
+ assert render_to_string(TheTranscriberBackend.ErrorView, "404.html", []) ==
+ "Page not found"
+ end
+
+ test "render 500.html" do
+ assert render_to_string(TheTranscriberBackend.ErrorView, "500.html", []) ==
+ "Internal server error"
+ end
+
+ test "render any other" do
+ assert render_to_string(TheTranscriberBackend.ErrorView, "505.html", []) ==
+ "Internal server error"
+ end
+end