Skip to main content

assert_validation_error

Function assert_validation_error 

Source
pub fn assert_validation_error<T, E>(result: &Result<T, E>, field: &str)
where T: Debug, E: Debug + Display,
Expand description

Assert that a validation error occurred for a specific field.

This checks if the error message mentions the specified field name, which is a common pattern for validation errors.