diff options
author | Azul <azul@leap.se> | 2013-07-18 11:31:25 +0200 |
---|---|---|
committer | Azul <azul@leap.se> | 2013-07-24 10:55:50 +0200 |
commit | 4a071ef1b33525fa2d1052aa7f21b549447fe767 (patch) | |
tree | ed293735e0123a3d5d6bc40d78dc2bebd8a64f8d /users/test/unit/identity_test.rb | |
parent | 38e7ba3a7c7a414c5b087f7f32df1a09403fff89 (diff) |
move identity creation into user class
It's always based on a user and most default values are based on user properties.
Diffstat (limited to 'users/test/unit/identity_test.rb')
-rw-r--r-- | users/test/unit/identity_test.rb | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/users/test/unit/identity_test.rb b/users/test/unit/identity_test.rb index 389ef89..3130ddc 100644 --- a/users/test/unit/identity_test.rb +++ b/users/test/unit/identity_test.rb @@ -7,13 +7,10 @@ class IdentityTest < ActiveSupport::TestCase 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 + id = @user.build_identity + assert_equal @user.email_address, id.address + assert_equal @user.email_address, id.destination + assert_equal @user, id.user end test "add alias" do |