diff --git a/lib/common.rb b/lib/common.rb index 0d1320361..36bfcd2fe 100644 --- a/lib/common.rb +++ b/lib/common.rb @@ -7,7 +7,7 @@ module Diaspora def notify_friends if self.person_id == User.first.id - xml = Post.build_xml_for(self) + xml = Post.build_xml_for([self]) @@queue.add_post_request( friends_with_permissions, CGI::escape(xml) ) @@queue.process end diff --git a/spec/lib/common_spec.rb b/spec/lib/common_spec.rb index 3b4be323b..8a37fc20a 100644 --- a/spec/lib/common_spec.rb +++ b/spec/lib/common_spec.rb @@ -59,8 +59,8 @@ describe Diaspora do end it "should send an owners post to their friends" do - Post.stub(:build_xml_for).and_return(true) - Post.should_receive(:build_xml_for).and_return true + q = Post.send (:class_variable_get, :@@queue) + q.should_receive :process @post.save end