mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-09-06 04:54:29 +08:00
Fix 404 rendering, closes #1826
This commit is contained in:
parent
4f92ef8d02
commit
6ef803f95b
2 changed files with 14 additions and 1 deletions
|
@ -5,7 +5,8 @@ config :livebook, LivebookWeb.Endpoint,
|
||||||
url: [host: "localhost", path: "/"],
|
url: [host: "localhost", path: "/"],
|
||||||
pubsub_server: Livebook.PubSub,
|
pubsub_server: Livebook.PubSub,
|
||||||
live_view: [signing_salt: "livebook"],
|
live_view: [signing_salt: "livebook"],
|
||||||
drainer: [shutdown: 1000]
|
drainer: [shutdown: 1000],
|
||||||
|
render_errors: [formats: [html: LivebookWeb.ErrorHTML], layout: false]
|
||||||
|
|
||||||
# Configures Elixir's Logger
|
# Configures Elixir's Logger
|
||||||
config :logger, :console,
|
config :logger, :console,
|
||||||
|
|
12
test/livebook_web/controllers/errors_test.exs
Normal file
12
test/livebook_web/controllers/errors_test.exs
Normal 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
|
Loading…
Add table
Reference in a new issue