Skip to content

Removing redundant error about existing email

Issues:

    1. 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:

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

Merge request reports