-
-
Notifications
You must be signed in to change notification settings - Fork 486
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6150 from Raushan998/feature/email_validate_message
Feature/email validate message
- Loading branch information
Showing
3 changed files
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,6 +55,13 @@ | |
expect(user.errors[:base]).to eq([" Date of birth must be on or after 1/1/1920."]) | ||
end | ||
|
||
it "shows custom email uniqueness error message" do | ||
create(:user, email: "[email protected]") | ||
user = build(:user, email: "[email protected]") | ||
expect(user.valid?).to be false | ||
expect(user.errors[:base]).to eq([I18n.t("activerecord.errors.messages.email_uniqueness")]) | ||
end | ||
|
||
it "has an empty old_emails array when initialized" do | ||
user = build(:user) | ||
expect(user.old_emails).to eq([]) | ||
|