Ash does not seem to provide an errors_on
like function you’d normally get in a Phoenix project template, and I’m in my test trying to validate failure expectations.
Any recommendations for how I should be extracting error messages from Ash.Error
during tests?
test "fails: with a short password" do
email = "mike@mikezornek.com"
password = "short"
password_confirmation = "short"
assert {:error, ash_error} =
User.register_with_password(
email,
password,
password_confirmation
)
# normally I'd do something like:
# assert "should be at least 8 character(s)" in errors_on(changeset).password
# Q: What function should I lean on to extract error strings per field from `Ash.Error`?
dbg(ash_error)
assert false
end