Open zimt28 opened 6 years ago
ValidField should fail, when fields do not exist:
ValidField
%Resource{} |> with_changeset() |> assert_field(:i_dont_exist, [:hi], []) # Passes %Resource{} |> with_changeset() |> assert_field(:i_dont_exist, [:hi], [:ok]) # ** (ValidField.ValidationError) Expected the following values to be invalid for "nonexistant": :ok
This is helpful when misspelling a field because if no invalid values are set, it might go unnoticed.
Good catch, did you want to PR? It might be a bit until I can tackle
I tried, see https://github.com/DockYard/valid_field/pull/31.
ValidField
should fail, when fields do not exist:This is helpful when misspelling a field because if no invalid values are set, it might go unnoticed.