2022-09-28 09:54:05 +13:00
|
|
|
defmodule AshAuthenticationTest do
|
2022-10-25 11:07:07 +13:00
|
|
|
@moduledoc false
|
2022-09-28 09:54:05 +13:00
|
|
|
use ExUnit.Case
|
|
|
|
doctest AshAuthentication
|
|
|
|
|
2022-10-25 11:07:07 +13:00
|
|
|
describe "authenticated_resources/0" do
|
|
|
|
test "it correctly locates all authenticatable resources" do
|
|
|
|
assert [
|
|
|
|
%{
|
|
|
|
api: Example,
|
2022-11-04 11:24:33 +13:00
|
|
|
providers: providers,
|
2022-10-25 11:07:07 +13:00
|
|
|
resource: Example.UserWithUsername,
|
|
|
|
subject_name: :user_with_username
|
|
|
|
}
|
|
|
|
] = AshAuthentication.authenticated_resources(:ash_authentication)
|
2022-11-04 11:24:33 +13:00
|
|
|
|
|
|
|
assert AshAuthentication.PasswordAuthentication in providers
|
|
|
|
assert AshAuthentication.PasswordReset in providers
|
2022-10-25 11:07:07 +13:00
|
|
|
end
|
2022-09-28 09:54:05 +13:00
|
|
|
end
|
|
|
|
end
|