diff --git a/lib/live_babiniku_web/components/error_view.ex b/lib/live_babiniku_web/components/error_view.ex index c3058ac..d5c4457 100644 --- a/lib/live_babiniku_web/components/error_view.ex +++ b/lib/live_babiniku_web/components/error_view.ex @@ -10,7 +10,7 @@ defmodule LiveBabinikuWeb.ErrorView do # By default, Phoenix returns the status message from # the template name. For example, "404.html" becomes # "Not Found". - def template_not_found(template, _assigns) do + def render(template, _assigns) do Phoenix.Controller.status_message_from_template(template) end end diff --git a/test/live_babiniku_web/views/error_view_test.exs b/test/live_babiniku_web/views/error_view_test.exs index 3974411..517ebaa 100644 --- a/test/live_babiniku_web/views/error_view_test.exs +++ b/test/live_babiniku_web/views/error_view_test.exs @@ -2,13 +2,13 @@ defmodule LiveBabinikuWeb.ErrorViewTest do use LiveBabinikuWeb.ConnCase, async: true # Bring render/3 and render_to_string/3 for testing custom views - import Phoenix.View + import Phoenix.Template test "renders 404.html" do - assert render_to_string(LiveBabinikuWeb.ErrorView, "404.html", []) == "Not Found" + assert render_to_string(LiveBabinikuWeb.ErrorView, "404.html", "html", []) == "Not Found" end test "renders 500.html" do - assert render_to_string(LiveBabinikuWeb.ErrorView, "500.html", []) == "Internal Server Error" + assert render_to_string(LiveBabinikuWeb.ErrorView, "500.html", "html", []) == "Internal Server Error" end end