diff options
| author | Melonai <einebeere@gmail.com> | 2021-05-07 17:11:50 +0200 |
|---|---|---|
| committer | Melonai <einebeere@gmail.com> | 2021-05-07 17:11:50 +0200 |
| commit | 88c0fbf10145ddd4ccd10ee432b4ca1aadd96a91 (patch) | |
| tree | 33691a532f460dbdf8a0e7909b898c0b324eaa2f /test/guard_web/views | |
| download | rook-88c0fbf10145ddd4ccd10ee432b4ca1aadd96a91.tar.zst rook-88c0fbf10145ddd4ccd10ee432b4ca1aadd96a91.zip | |
Initial structure
Diffstat (limited to 'test/guard_web/views')
| -rw-r--r-- | test/guard_web/views/error_view_test.exs | 14 | ||||
| -rw-r--r-- | test/guard_web/views/layout_view_test.exs | 8 |
2 files changed, 22 insertions, 0 deletions
diff --git a/test/guard_web/views/error_view_test.exs b/test/guard_web/views/error_view_test.exs new file mode 100644 index 0000000..6ec5f1c --- /dev/null +++ b/test/guard_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/guard_web/views/layout_view_test.exs b/test/guard_web/views/layout_view_test.exs new file mode 100644 index 0000000..48f119d --- /dev/null +++ b/test/guard_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 |
