View Source SchemaAssertions.ChangesetAssertions (Schema Assertions v1.1.0)
Assertions for changeset validity.
Summary
Functions
Assert that a changeset's fields match the expected values. The field values are obtained via
Ecto.Changeset.fetch_field!/2
and are the values from either the changes or the data.
Assert that a changeset is invalid, including asserting on all of its validation errors
Assert that a changeset is valid
Functions
Assert that a changeset's fields match the expected values. The field values are obtained via
Ecto.Changeset.fetch_field!/2
and are the values from either the changes or the data.
assert_changeset_invalid(tuple_or_changeset, expected_errors \\ nil)
View SourceAssert that a changeset is invalid, including asserting on all of its validation errors
Example: assert_changeset_invalid(changeset, start_date: ["please enter dates as mm/dd/yyyy"])
Assert that a changeset is valid
Example: assert_changeset_valid(changeset)