Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix normalization of BatchInvitationUser#email
Trello: https://trello.com/c/aO4nVCZT Having implemented strip_whitespace_from_organisation_slug I realised I'd probably missed a scenario for strip_whitespace_from_email. And sure enough there was no test coverage for the case when BatchInvitationUser#email is nil. In this commit I've improved the test coverage for email validation which for one thing explicitly forces the presence validation to be enabled for the email attribute, and for another, it forces me to use the safe navigation operator in strip_whitespace_from_email. This is because the latter is called from a before_validation callback and so email could be nil at this point.
- Loading branch information