ash_authentication/test/ash_authentication_test.exs
James Harton bab9ec363e
fix(PasswordReset): Generate the reset token using the target action, not the source action. (#25)
* fix(PasswordReset): Generate the reset token using the target action, not the source action.

Also improve tests.

* improvement(PasswordReset): rework PasswordReset to be a provider in it's own right - this means it has it's own routes, etc.
2022-11-04 11:24:33 +13:00

21 lines
656 B
Elixir

defmodule AshAuthenticationTest do
@moduledoc false
use ExUnit.Case
doctest AshAuthentication
describe "authenticated_resources/0" do
test "it correctly locates all authenticatable resources" do
assert [
%{
api: Example,
providers: providers,
resource: Example.UserWithUsername,
subject_name: :user_with_username
}
] = AshAuthentication.authenticated_resources(:ash_authentication)
assert AshAuthentication.PasswordAuthentication in providers
assert AshAuthentication.PasswordReset in providers
end
end
end