diff --git a/app/models/user.rb b/app/models/user.rb index 0e19eb6af..a70594adc 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -166,13 +166,18 @@ class User aspect.save target_people = target_people | aspect.people } + push_to_people(post, target_people) end def push_to_people(post, people) + puts post.inspect + puts post.to_diaspora_xml + puts "Leaving push_to_people" salmon = salmon(post) people.each{|person| - push_to_person( person, salmon.xml_for( person )) + xml = salmon.xml_for person + push_to_person( person, xml) } end @@ -184,7 +189,10 @@ class User end def salmon( post ) - Salmon::SalmonSlap.create(self, post.to_diaspora_xml) + puts post.inspect + puts post.to_diaspora_xml + created_salmon = Salmon::SalmonSlap.create(self, post.to_diaspora_xml) + created_salmon end ######## Commenting ######## diff --git a/spec/models/user/posting_spec.rb b/spec/models/user/posting_spec.rb index d86433ad6..518c03d2d 100644 --- a/spec/models/user/posting_spec.rb +++ b/spec/models/user/posting_spec.rb @@ -71,19 +71,19 @@ describe User do describe '#push_to_aspects' do it 'should push a post to a aspect' do - user.should_receive(:salmon).twice + user.should_receive(:push_to_person).twice user.push_to_aspects(post, aspect.id) end it 'should push a post to all aspects' do - user.should_receive(:salmon).exactly(3).times + user.should_receive(:push_to_person).exactly(3).times user.push_to_aspects(post, :all) end end describe '#push_to_people' do it 'should push to people' do - user.should_receive(:salmon).twice + user.should_receive(:push_to_person).twice user.push_to_people(post, [user2.person, user3.person]) end end