1
0
Fork 0
mirror of https://github.com/heartcombo/devise.git synced 2022-11-09 12:18:31 -05:00

add test for Devise.email_regexp

This commit is contained in:
Anatoliy Kukul 2012-11-19 17:38:22 +02:00
parent adc9a45f05
commit f0f3e15c08

View file

@ -68,5 +68,16 @@ class DeviseTest < ActiveSupport::TestCase
end
assert_not Devise.secure_compare("size_1", "size_four")
end
test 'Devise.email_regexp should match valid email addresses' do
valid_emails = ["test@example.com", "jo@jo.co", "f4$_m@you.com", "testing.example@example.com.ua"]
non_valid_emails = ["rex", "test@go,com", "test user@example.com", "test_user@example server.com"]
valid_emails.each do |email|
assert_match Devise.email_regexp, email
end
non_valid_emails.each do |email|
assert_no_match Devise.email_regexp, email
end
end
end