Commit 74589b8f050fe5b8467ec361b7862c830459f858

Authored by Leandro Santos
1 parent 86c2f5ee

Fix FriendsBlock unit test

app/models/friends_block.rb
... ... @@ -14,7 +14,7 @@ class FriendsBlock < ProfileListBlock
14 14  
15 15 def footer
16 16 owner_id = owner.identifier
17   - lambda do
  17 + proc do
18 18 link_to s_('friends|View all'), :profile => owner_id, :controller => 'profile', :action => 'friends'
19 19 end
20 20 end
... ...
app/models/person.rb
... ... @@ -102,7 +102,10 @@ class Person < Profile
102 102  
103 103 def add_friend(friend, group = nil)
104 104 unless self.is_a_friend?(friend)
105   - self.friendships.build(:friend => friend, :group => group).save!
  105 + friendship = self.friendships.build
  106 + friendship.friend = friend
  107 + friendship.group = group
  108 + friendship.save
106 109 end
107 110 end
108 111  
... ...