mirror of
https://github.com/mgerb/classic-wow-forums
synced 2026-01-11 17:42:48 +00:00
init
This commit is contained in:
21
test/myapp_web/views/error_view_test.exs
Normal file
21
test/myapp_web/views/error_view_test.exs
Normal file
@@ -0,0 +1,21 @@
|
||||
defmodule MyAppWeb.ErrorViewTest do
|
||||
use MyAppWeb.ConnCase, async: true
|
||||
|
||||
# Bring render/3 and render_to_string/3 for testing custom views
|
||||
import Phoenix.View
|
||||
|
||||
test "renders 404.json" do
|
||||
assert render(MyAppWeb.ErrorView, "404.json", []) ==
|
||||
%{errors: %{detail: "Page not found"}}
|
||||
end
|
||||
|
||||
test "render 500.json" do
|
||||
assert render(MyAppWeb.ErrorView, "500.json", []) ==
|
||||
%{errors: %{detail: "Internal server error"}}
|
||||
end
|
||||
|
||||
test "render any other" do
|
||||
assert render(MyAppWeb.ErrorView, "505.json", []) ==
|
||||
%{errors: %{detail: "Internal server error"}}
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user