-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
68 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
test/elixir_boilerplate_web/controllers/error_html_test.exs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
defmodule ElixirBoilerplateWeb.ErrorHTMLTest do | ||
use ElixirBoilerplateWeb.ConnCase, async: true | ||
|
||
# Bring render_to_string/4 for testing custom views | ||
import Phoenix.Template | ||
|
||
test "renders 404.html" do | ||
assert render_to_string(ElixirBoilerplateWeb.ErrorHTML, "404", "html", []) == "Not Found" | ||
end | ||
|
||
test "renders 500.html" do | ||
assert render_to_string(ElixirBoilerplateWeb.ErrorHTML, "500", "html", []) == "Internal Server Error" | ||
end | ||
end |
12 changes: 12 additions & 0 deletions
12
test/elixir_boilerplate_web/controllers/error_json_test.exs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
defmodule ElixirBoilerplateWeb.ErrorJSONTest do | ||
use ElixirBoilerplateWeb.ConnCase, async: true | ||
|
||
test "renders 404" do | ||
assert ElixirBoilerplateWeb.ErrorJSON.render("404.json", %{}) == %{errors: %{detail: "Not Found"}} | ||
end | ||
|
||
test "renders 500" do | ||
assert ElixirBoilerplateWeb.ErrorJSON.render("500.json", %{}) == | ||
%{errors: %{detail: "Internal Server Error"}} | ||
end | ||
end |
8 changes: 8 additions & 0 deletions
8
test/elixir_boilerplate_web/controllers/page_controller_test.exs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
defmodule ElixirBoilerplateWeb.PageControllerTest do | ||
use ElixirBoilerplateWeb.ConnCase | ||
|
||
test "GET /", %{conn: conn} do | ||
conn = get(conn, "/") | ||
assert html_response(conn, 200) =~ "stable base upon which" | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters