diff --git a/lib/code_corps_web/views/error_view.ex b/lib/code_corps_web/views/error_view.ex index 205f92059..d28df59d9 100644 --- a/lib/code_corps_web/views/error_view.ex +++ b/lib/code_corps_web/views/error_view.ex @@ -2,19 +2,10 @@ defmodule CodeCorpsWeb.ErrorView do use CodeCorpsWeb, :view use JaSerializer.PhoenixView - def render("stripe-400.json-api", _assigns) do - %{ - title: "This authorization code has already been used. All tokens issued with this code have been revoked.", - detail: "This authorization code has already been used. All tokens issued with this code have been revoked.", - status: "400" - } - |> JaSerializer.ErrorSerializer.format - end - def render("404.json-api", _assigns) do %{ - title: "404 Resource not found", - detail: "404 Resource not found", + title: "404 Not Found", + detail: "404 Not Found", status: "404" } |> JaSerializer.ErrorSerializer.format @@ -22,8 +13,8 @@ defmodule CodeCorpsWeb.ErrorView do def render("500.json-api", _assigns) do %{ - title: "500 Internal server error", - detail: "500 Internal server error", + title: "500 Internal Server Error", + detail: "500 Internal Server Error", status: "500" } |> JaSerializer.ErrorSerializer.format diff --git a/test/lib/code_corps_web/views/error_view_test.exs b/test/lib/code_corps_web/views/error_view_test.exs index 165db4a9c..6547654df 100644 --- a/test/lib/code_corps_web/views/error_view_test.exs +++ b/test/lib/code_corps_web/views/error_view_test.exs @@ -8,7 +8,7 @@ defmodule CodeCorpsWeb.ErrorViewTest do rendered_json = render(CodeCorpsWeb.ErrorView, "404.json-api", []) expected_json = %{ - "errors" => [%{title: "404 Resource not found", detail: "404 Resource not found", status: "404"}], + "errors" => [%{title: "404 Not Found", detail: "404 Not Found", status: "404"}], "jsonapi" => %{"version" => "1.0"} } assert rendered_json == expected_json @@ -18,7 +18,7 @@ defmodule CodeCorpsWeb.ErrorViewTest do rendered_json = render(CodeCorpsWeb.ErrorView, "500.json-api", []) expected_json = %{ - "errors" => [%{title: "500 Internal server error", detail: "500 Internal server error", status: "500"}], + "errors" => [%{title: "500 Internal Server Error", detail: "500 Internal Server Error", status: "500"}], "jsonapi" => %{"version" => "1.0"} } assert rendered_json == expected_json @@ -27,6 +27,6 @@ defmodule CodeCorpsWeb.ErrorViewTest do test "render any other" do string = render_to_string(CodeCorpsWeb.ErrorView, "505.json-api", []) - assert String.contains? string, "Internal server error" + assert String.contains? string, "Internal Server Error" end end