diff options
author | href <href@random.sh> | 2018-01-31 20:36:42 +0100 |
---|---|---|
committer | href <href@random.sh> | 2018-01-31 20:36:42 +0100 |
commit | fcb2a082346054108f3f16cffe968450cf961976 (patch) | |
tree | 8e7d2eb9eeebf854e62e08c29b147f34dfeb1881 /test/lsg_web/views |
import
Diffstat (limited to 'test/lsg_web/views')
-rw-r--r-- | test/lsg_web/views/error_view_test.exs | 21 | ||||
-rw-r--r-- | test/lsg_web/views/layout_view_test.exs | 3 | ||||
-rw-r--r-- | test/lsg_web/views/page_view_test.exs | 3 |
3 files changed, 27 insertions, 0 deletions
diff --git a/test/lsg_web/views/error_view_test.exs b/test/lsg_web/views/error_view_test.exs new file mode 100644 index 0000000..2aae44d --- /dev/null +++ b/test/lsg_web/views/error_view_test.exs @@ -0,0 +1,21 @@ +defmodule LSGWeb.ErrorViewTest do + use LSGWeb.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(LSGWeb.ErrorView, "404.html", []) == + "Page not found" + end + + test "render 500.html" do + assert render_to_string(LSGWeb.ErrorView, "500.html", []) == + "Internal server error" + end + + test "render any other" do + assert render_to_string(LSGWeb.ErrorView, "505.html", []) == + "Internal server error" + end +end diff --git a/test/lsg_web/views/layout_view_test.exs b/test/lsg_web/views/layout_view_test.exs new file mode 100644 index 0000000..5a904f8 --- /dev/null +++ b/test/lsg_web/views/layout_view_test.exs @@ -0,0 +1,3 @@ +defmodule LSGWeb.LayoutViewTest do + use LSGWeb.ConnCase, async: true +end diff --git a/test/lsg_web/views/page_view_test.exs b/test/lsg_web/views/page_view_test.exs new file mode 100644 index 0000000..26fce45 --- /dev/null +++ b/test/lsg_web/views/page_view_test.exs @@ -0,0 +1,3 @@ +defmodule LSGWeb.PageViewTest do + use LSGWeb.ConnCase, async: true +end |