Skip to content
Extraits de code Groupes Projets
Valider 3b07596b rédigé par maxwell's avatar maxwell
Parcourir les fichiers

Merge branch 'master' of github.com:diaspora/diaspora

parents 2be0cca2 bfdf220f
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -86,7 +86,8 @@ module Diaspora ...@@ -86,7 +86,8 @@ module Diaspora
def remove_friend(bad_friend) def remove_friend(bad_friend)
raise "Friend not deleted" unless self.friend_ids.delete( bad_friend.id ) raise "Friend not deleted" unless self.friend_ids.delete( bad_friend.id )
aspects.each{|g| g.person_ids.delete( bad_friend.id )} aspects.each{|aspect|
aspect.person_ids.delete( bad_friend.id )}
self.save self.save
self.raw_visible_posts.find_all_by_person_id( bad_friend.id ).each{|post| self.raw_visible_posts.find_all_by_person_id( bad_friend.id ).each{|post|
......
...@@ -189,16 +189,14 @@ describe User do ...@@ -189,16 +189,14 @@ describe User do
@user2 = Factory.create :user @user2 = Factory.create :user
@aspect2 = @user2.aspect(:name => "Gross people") @aspect2 = @user2.aspect(:name => "Gross people")
request = @user.send_friend_request_to( @user2, @aspect) friend_users(@user, @aspect, @user2, @aspect2)
request.reverse_for @user2
@user2.activate_friend(@user.person, @aspect2)
@user.receive request.to_diaspora_xml
end
it 'should unfriend the other user on the same seed' do
@user.reload @user.reload
@user2.reload @user2.reload
@aspect.reload
@aspect2.reload
end
it 'should unfriend the other user on the same seed' do
@user.friends.count.should == 1 @user.friends.count.should == 1
@user2.friends.count.should == 1 @user2.friends.count.should == 1
...@@ -212,6 +210,25 @@ describe User do ...@@ -212,6 +210,25 @@ describe User do
@aspect.people.count.should == 0 @aspect.people.count.should == 0
@aspect2.people.count.should == 0 @aspect2.people.count.should == 0
end end
context 'with a post' do
before do
@message = @user.post(:status_message, :message => "hi", :to => @aspect.id)
@user2.receive @message.to_diaspora_xml.to_s
@user2.unfriend @user.person
@user.unfriended_by @user2.person
@aspect.reload
@aspect2.reload
@user.reload
@user2.reload
end
it "deletes the unfriended user's posts from visible_posts" do
@user.raw_visible_posts.include?(@message.id).should be_false
end
it "deletes the unfriended user's posts from the aspect's posts" do
pending "We need to implement this"
@aspect2.posts.include?(@message).should be_false
end
end
end end
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter