ash_authentication_phoenix/test/router_test.exs
Zach Daniel 9f5feedc7d
feat: Dynamic Router + compile time dependency fixes (#487)
* improvement: create a new dynamic router, and avoid other compile time dependencies

* chore: "fix" credo
2024-08-08 20:03:48 -04:00

26 lines
836 B
Elixir

defmodule AshAuthentication.Phoenix.RouterTest do
@moduledoc false
use ExUnit.Case
test "sign_in_routes adds a route according to its scope" do
route =
AshAuthentication.Phoenix.Test.Router
|> Phoenix.Router.routes()
|> Enum.find(&(&1.path == "/sign-in"))
{_, _, _, %{extra: %{session: session}}} = route.metadata.phoenix_live_view
assert session ==
{AshAuthentication.Phoenix.Router, :generate_session,
[
%{
"auth_routes_prefix" => "/auth",
"otp_app" => nil,
"overrides" => [AshAuthentication.Phoenix.Overrides.Default],
"path" => "/sign-in",
"register_path" => "/register",
"reset_path" => "/reset"
}
]}
end
end