summaryrefslogtreecommitdiff
path: root/users/test/unit
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2013-07-16 19:38:37 +0200
committerAzul <azul@leap.se>2013-07-24 10:55:50 +0200
commit38e7ba3a7c7a414c5b087f7f32df1a09403fff89 (patch)
treedbb786b3abe10cefb226bf53297fa219cdef864f /users/test/unit
parent21f39bf368ea1e0deb70eb918f0947fb6fbd900d (diff)
first take on identity model - still broken
Diffstat (limited to 'users/test/unit')
-rw-r--r--users/test/unit/identity_test.rb34
1 files changed, 34 insertions, 0 deletions
diff --git a/users/test/unit/identity_test.rb b/users/test/unit/identity_test.rb
new file mode 100644
index 0000000..389ef89
--- /dev/null
+++ b/users/test/unit/identity_test.rb
@@ -0,0 +1,34 @@
+require 'test_helper'
+
+class IdentityTest < ActiveSupport::TestCase
+
+ setup do
+ @user = FactoryGirl.create(:user)
+ end
+
+ test "user has identity to start with" do
+ id = Identity.new user_id: @user.id
+ id.save
+ assert_equal 1, Identity.by_user_id.key(@user.id).count
+ identity = Identity.find_by_user_id(@user.id)
+ assert_equal @user.email_address, identity.address
+ assert_equal @user.email_address, identity.destination
+ assert_equal @user, identity.user
+ end
+
+ test "add alias" do
+ skip
+ @user.create_identity address: @alias
+ end
+
+ test "add forward" do
+ skip
+ @user.create_identity destination: @external
+ end
+
+ test "forward alias" do
+ skip
+ @user.create_identity address: @alias, destination: @external
+ end
+
+end