From 59adb0892f443e1fe1bdd4201c4e0db1b036e0af Mon Sep 17 00:00:00 2001 From: jessib Date: Thu, 5 Sep 2013 13:12:23 -0700 Subject: Test of failing to add non-local email address as an identity's address. --- users/test/unit/identity_test.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'users/test/unit') diff --git a/users/test/unit/identity_test.rb b/users/test/unit/identity_test.rb index fa88315..a77613a 100644 --- a/users/test/unit/identity_test.rb +++ b/users/test/unit/identity_test.rb @@ -70,6 +70,13 @@ class IdentityTest < ActiveSupport::TestCase id.destroy end + test "fail to end non-local email address as identity address" do + id = Identity.for @user, address: 'blah@sdlfksjdfljk.com' + assert !id.valid? + assert_match /needs to end in/, id.errors[:address].first + end + + def alias_name @alias_name ||= Faker::Internet.user_name end -- cgit v1.2.3