From fcb2a082346054108f3f16cffe968450cf961976 Mon Sep 17 00:00:00 2001 From: href Date: Wed, 31 Jan 2018 20:36:42 +0100 Subject: import --- test/lsg_web/views/error_view_test.exs | 21 +++++++++++++++++++++ test/lsg_web/views/layout_view_test.exs | 3 +++ test/lsg_web/views/page_view_test.exs | 3 +++ 3 files changed, 27 insertions(+) create mode 100644 test/lsg_web/views/error_view_test.exs create mode 100644 test/lsg_web/views/layout_view_test.exs create mode 100644 test/lsg_web/views/page_view_test.exs (limited to 'test/lsg_web/views') 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 -- cgit v1.2.3