comments do not queue up jobs for local users.
This commit is contained in:
parent
f2f3059d72
commit
c16d0c46a2
2 changed files with 20 additions and 9 deletions
|
|
@ -23,10 +23,12 @@ class Postzord::Dispatch
|
|||
user_ids = [*local_people].map{|x| x.owner_id }
|
||||
local_users = User.all(:id.in => user_ids, :fields => ['person_id, username, language, email'])
|
||||
self.socket_to_users(local_users)
|
||||
end
|
||||
self.deliver_to_remote(remote_people)
|
||||
else
|
||||
self.deliver_to_local(local_people)
|
||||
end
|
||||
|
||||
self.deliver_to_remote(remote_people)
|
||||
end
|
||||
self.deliver_to_services(opts[:url])
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -82,6 +82,15 @@ describe Postzord::Dispatch do
|
|||
mailman.should_receive(:socket_to_users)
|
||||
mailman.post
|
||||
end
|
||||
|
||||
it 'does not call deliver_to_local if the object is a comment' do
|
||||
comment = @local_user.comment "yo", :on => Factory(:status_message)
|
||||
comment.should_receive(:subscribers).and_return([@local_user])
|
||||
mailman = Postzord::Dispatch.new(@user, comment)
|
||||
mailman.should_receive(:socket_to_users)
|
||||
mailman.should_not_receive(:deliver_to_local)
|
||||
mailman.post
|
||||
end
|
||||
end
|
||||
|
||||
describe '#deliver_to_remote' do
|
||||
|
|
|
|||
Loading…
Reference in a new issue