Removing redundant error about existing email
Issues:
-
- When registering with an email already used by other user, two error messages are shown saying that the "email is already been taken" (duplicated).
- 2 )If not filling in the email field on registration, two error messages say the same "Email can't be blank" (duplicated)
Analysis:
- Is seems devise is configured to use email for default authentication. The 'validatable' option in the user model already does validation for email presence, uniqueness, and format http://www.rubydoc.info/github/plataformatec/devise/Devise/Models/Validatable
Solution:
- Test added to reproduce issue 1 and guarantee no duplication
- Test added to guarantee email presence is still validated, but do not guarantee no duplication (issue 2)
- I removed the validates presence and uniqueness options for the email field in the user model.
Improvements:
- I still left the email strict_mode validation, but probably this validation is already done by devise