mirror of
https://github.com/kevin-DL/phoenix_api_template.git
synced 2026-01-12 02:55:13 +00:00
Initial commit
This commit is contained in:
15
test/phoenix_api_template_web/views/error_view_test.exs
Normal file
15
test/phoenix_api_template_web/views/error_view_test.exs
Normal file
@@ -0,0 +1,15 @@
|
||||
defmodule PhoenixApiTemplateWeb.ErrorViewTest do
|
||||
use PhoenixApiTemplateWeb.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(PhoenixApiTemplateWeb.ErrorView, "404.json", []) == %{errors: %{detail: "Not Found"}}
|
||||
end
|
||||
|
||||
test "renders 500.json" do
|
||||
assert render(PhoenixApiTemplateWeb.ErrorView, "500.json", []) ==
|
||||
%{errors: %{detail: "Internal Server Error"}}
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user