Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aleDsz committed Oct 1, 2024
1 parent 5e4c9a7 commit 72cf3e7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions lib/livebook_web/controllers/error_controller.ex
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
defmodule LivebookWeb.ErrorController do
use LivebookWeb, :controller

def show(conn, %{"error" => "unauthorized"}) do
conn
|> put_status(:unauthorized)
|> render("401.html", %{status: 401})
def unauthorized(conn, _) do
conn |> put_status(:unauthorized) |> render("401.html", %{status: 401})
end
end
2 changes: 1 addition & 1 deletion lib/livebook_web/router.ex
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ defmodule LivebookWeb.Router do
scope "/", LivebookWeb do
pipe_through :browser

get "/:error", ErrorController, :show
get "/unauthorized", ErrorController, :unauthorized
end

scope "/" do
Expand Down
2 changes: 1 addition & 1 deletion test/support/hub_helpers.ex
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ defmodule Livebook.HubHelpers do
end

defp hub_pid(hub) do
if pid = GenServer.whereis({:via, Registry, {Livebook.HubsRegistry, hub.id}}) do
if pid = Livebook.Hubs.TeamClient.get_pid(hub.id) do
{:ok, pid}
end
end
Expand Down

0 comments on commit 72cf3e7

Please sign in to comment.