about summary refs log tree commit diff
path: root/test/rook_web/views
diff options
context:
space:
mode:
authorMelonai <einebeere@gmail.com>2021-05-13 02:18:25 +0200
committerMelonai <einebeere@gmail.com>2021-05-13 02:18:25 +0200
commit0bd75cadf7164979cc06f001ecc057f6275a2e3b (patch)
tree806eafe2bc732dd043d9e589ba6e1421a0569c21 /test/rook_web/views
parent14617077c7e348a3caa9f03224e7558beb680068 (diff)
downloadrook-0bd75cadf7164979cc06f001ecc057f6275a2e3b.tar.zst
rook-0bd75cadf7164979cc06f001ecc057f6275a2e3b.zip
Rename test folders to rook_web
Diffstat (limited to 'test/rook_web/views')
-rw-r--r--test/rook_web/views/error_view_test.exs14
-rw-r--r--test/rook_web/views/layout_view_test.exs8
2 files changed, 22 insertions, 0 deletions
diff --git a/test/rook_web/views/error_view_test.exs b/test/rook_web/views/error_view_test.exs
new file mode 100644
index 0000000..6ec5f1c
--- /dev/null
+++ b/test/rook_web/views/error_view_test.exs
@@ -0,0 +1,14 @@
+defmodule RookWeb.ErrorViewTest do
+  use RookWeb.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(RookWeb.ErrorView, "404.html", []) == "Not Found"
+  end
+
+  test "renders 500.html" do
+    assert render_to_string(RookWeb.ErrorView, "500.html", []) == "Internal Server Error"
+  end
+end
diff --git a/test/rook_web/views/layout_view_test.exs b/test/rook_web/views/layout_view_test.exs
new file mode 100644
index 0000000..48f119d
--- /dev/null
+++ b/test/rook_web/views/layout_view_test.exs
@@ -0,0 +1,8 @@
+defmodule RookWeb.LayoutViewTest do
+  use RookWeb.ConnCase, async: true
+
+  # When testing helpers, you may want to import Phoenix.HTML and
+  # use functions such as safe_to_string() to convert the helper
+  # result into an HTML string.
+  # import Phoenix.HTML
+end