Sometimes, seemingly redundant tests could serve as an assurance that our code works. While it's possible to abstract away the tests to a higher le...
For further actions, you may consider blocking this person and/or reporting abuse
Thank you for introducing to this nice pattern.
By reading and trying the code I think that
UserTest
, in helper functions pattern, is missing an import toExUnit.Assertions
which containsassert
function.Another thing I could think of that could think off is putting
assert
inassert not_blank(schema, field)
is a bit redundant here. I think we could renamenot_blank/2
toassert_not_blank/2
.how do think of my thoughts? Thank you for posting nice patterns.
Updated the missing
import
. Thanks!assert_not_blank/2
is a great idea since its error message can be customized to fit the assertion.assert not_blank(schema, field)
on the otherhand would produce an unhelpful"Expected truthy, got false"
error message.