summaryrefslogtreecommitdiff
path: root/users/test/unit/email_test.rb
diff options
context:
space:
mode:
authorazul <azul@riseup.net>2012-12-20 01:53:32 -0800
committerazul <azul@riseup.net>2012-12-20 01:53:32 -0800
commit69a6c34998328b2168053184e1e487b60e1cc536 (patch)
tree361b0be19535b0d7ddb3eaac7acdfcebc7a0e3a8 /users/test/unit/email_test.rb
parente899e5c3f33acb3228fac295013d7cc8b6e4eb04 (diff)
parentdc827d0a80360aa245d4d724dc42bc47571faea6 (diff)
Merge pull request #5 from leapcode/feature/removing-email-aliases
Removing email aliases - proper error display
Diffstat (limited to 'users/test/unit/email_test.rb')
-rw-r--r--users/test/unit/email_test.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/users/test/unit/email_test.rb b/users/test/unit/email_test.rb
index 1e216d6..6f9beaa 100644
--- a/users/test/unit/email_test.rb
+++ b/users/test/unit/email_test.rb
@@ -14,15 +14,15 @@ class EmailTest < ActiveSupport::TestCase
teardown do
@user.destroy if @user.persisted? # just in case
- @other_user.destroy
+ @other_user.destroy if @other_user.persisted?
end
test "email aliases need to be unique" do
email_alias = "valid_alias@domain.net"
- @other_user.add_email_alias email_alias
+ @other_user.email_aliases.build :email => email_alias
@other_user.save
- @user.add_email_alias email_alias
+ @user.email_aliases.build :email => email_alias
assert @user.changed?
assert !@user.save
# TODO handle errors
@@ -32,7 +32,7 @@ class EmailTest < ActiveSupport::TestCase
email_alias = "valid_alias@domain.net"
@other_user.email = email_alias
@other_user.save
- @user.add_email_alias email_alias
+ @user.email_aliases.build :email => email_alias
assert @user.changed?
assert !@user.save
end