-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(email_validator): handle trailing whitespace in emails (#255)
- Updated email_validator to strip trailing whitespace from emails when the `multiple` option is enabled. - Added a test case to ensure emails with trailing whitespace are considered invalid.
- Loading branch information
Showing
2 changed files
with
7 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -158,6 +158,11 @@ class TestUserMultiple < TestModel | |
user = TestUser.new(email: "[email protected]") | ||
expect(user.valid?).to be_falsy | ||
end | ||
|
||
it "is invalid with trailing whitespace" do | ||
user = TestUser.new(email: "[email protected] ") | ||
expect(user.valid?).to be_falsey | ||
end | ||
end | ||
|
||
describe "with disposable validation" do | ||
|