Fix 404 rendering, closes #1826

This commit is contained in:
José Valim 2023-03-25 21:52:18 +01:00
parent 4f92ef8d02
commit 6ef803f95b
2 changed files with 14 additions and 1 deletions

View file

@ -5,7 +5,8 @@ config :livebook, LivebookWeb.Endpoint,
url: [host: "localhost", path: "/"],
pubsub_server: Livebook.PubSub,
live_view: [signing_salt: "livebook"],
drainer: [shutdown: 1000]
drainer: [shutdown: 1000],
render_errors: [formats: [html: LivebookWeb.ErrorHTML], layout: false]
# Configures Elixir's Logger
config :logger, :console,

View file

@ -0,0 +1,12 @@
defmodule LivebookWeb.ErrorsTest do
use LivebookWeb.ConnCase, async: true
test "renders 404", %{conn: conn} do
response = assert_error_sent :not_found, fn ->
get(conn, "/this/does/not/exist")
end
assert {404, _, body} = response
assert body =~ "No Numbats here!"
end
end