summaryrefslogtreecommitdiff
path: root/users/test/unit/identity_test.rb
diff options
context:
space:
mode:
authorjessib <jessib@riseup.net>2013-09-05 13:12:23 -0700
committerjessib <jessib@riseup.net>2013-09-05 13:12:23 -0700
commit59adb0892f443e1fe1bdd4201c4e0db1b036e0af (patch)
tree16d296306bf6e1aee9807dc3e2ea68d7af4c1687 /users/test/unit/identity_test.rb
parentb79d8ae03339e2957c50111f0eae405ca1440674 (diff)
Test of failing to add non-local email address as an identity's address.
Diffstat (limited to 'users/test/unit/identity_test.rb')
-rw-r--r--users/test/unit/identity_test.rb7
1 files changed, 7 insertions, 0 deletions
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