Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- valid_model.should validate(:with_message => "Unacceptable email address.") do
- valid :email => "foo@bar.com"
- valid :email => "foo+extension@bar.com"
- valid :email => "foo-bar@test.com"
- valid :email => "foo-bar@test.domain.com"
- invalid :email => "anything@domain.we.dont.like"
- invalid :email => "no spaces please foo@bar.com"
- invalid :email => "@no.username.com"
- invalid :email => "only_tld@com"
- end
- valid_model.should validate(:error_message => "local users must use a local username")
- valid :email => "username", :type => "local"
- valid :email => "username@local.domain", :type => "local"
- invalid :email => "username@domain.com", :type => "local"
- end
- valid_model.should validate(:error_message => "Should provide email address") do
- invalid :email => ""
- valid :email => "", :status => "registration incomplete"
- valid :email => "", :user_role => "fake"
- valid :email => "", :user_role => "admin"
- end
Add Comment
Please, Sign In to add comment