aboutsummaryrefslogtreecommitdiff
path: root/test/views
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--test/views/error_view_test.exs21
-rw-r--r--test/views/layout_view_test.exs3
-rw-r--r--test/views/page_view_test.exs3
3 files changed, 27 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
diff --git a/test/views/layout_view_test.exs b/test/views/layout_view_test.exs
new file mode 100644
index 0000000..b060307
--- /dev/null
+++ b/test/views/layout_view_test.exs
@@ -0,0 +1,3 @@
+defmodule TheTranscriberBackend.LayoutViewTest do
+ use TheTranscriberBackend.ConnCase, async: true
+end
diff --git a/test/views/page_view_test.exs b/test/views/page_view_test.exs
new file mode 100644
index 0000000..7aa5589
--- /dev/null
+++ b/test/views/page_view_test.exs
@@ -0,0 +1,3 @@
+defmodule TheTranscriberBackend.PageViewTest do
+ use TheTranscriberBackend.ConnCase, async: true
+end