View Source SchemaAssertions.ChangesetAssertions (Schema Assertions v0.2.0)

Assertions for changeset validity.

Link to this section 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

Link to this section Functions

Link to this function

assert_changeset_fields(changeset, fields)

View Source

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.

Link to this function

assert_changeset_invalid(tuple_or_changeset, expected_errors \\ nil)

View Source

Assert 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"])

Link to this function

assert_changeset_valid(changeset)

View Source

Assert that a changeset is valid

Example: assert_changeset_valid(changeset)