Remove unused receive local job
This commit is contained in:
parent
4943531013
commit
8c7ad9a0a3
2 changed files with 0 additions and 63 deletions
|
|
@ -1,20 +0,0 @@
|
|||
# Copyright (c) 2010, Diaspora Inc. This file is
|
||||
# licensed under the Affero General Public License version 3 or later. See
|
||||
# the COPYRIGHT file.
|
||||
|
||||
|
||||
module Job
|
||||
class ReceiveLocal < Base
|
||||
require File.join(Rails.root, 'lib/postzord/receiver')
|
||||
|
||||
@queue = :receive_local
|
||||
def self.perform_delegate(user_id, person_id, object_type, object_id)
|
||||
user = User.find(user_id)
|
||||
person = Person.find(person_id)
|
||||
object = object_type.constantize.where(:id => object_id).first
|
||||
|
||||
z = Postzord::Receiver.new(user, :person => person, :object => object)
|
||||
z.receive_object
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe Job::ReceiveLocal do
|
||||
before do
|
||||
@user1 = alice
|
||||
@person1 = @user1.person
|
||||
@user2 = eve
|
||||
@person2 = @user2.person
|
||||
@status = Factory(:status_message)
|
||||
@status_type = @status.class.to_s
|
||||
|
||||
User.stub(:find){ |id|
|
||||
if id == @user1.id
|
||||
@user1
|
||||
else
|
||||
nil
|
||||
end
|
||||
}
|
||||
|
||||
Person.stub(:find){ |id|
|
||||
if id == @person2.id
|
||||
@person2
|
||||
else
|
||||
nil
|
||||
end
|
||||
}
|
||||
|
||||
StatusMessage.stub(:find){ |id|
|
||||
if id == @status.id
|
||||
@status
|
||||
else
|
||||
nil
|
||||
end
|
||||
}
|
||||
end
|
||||
|
||||
it 'calls receive_object' do
|
||||
m = mock()
|
||||
m.should_receive(:receive_object)
|
||||
Postzord::Receiver.should_receive(:new).and_return(m)
|
||||
Job::ReceiveLocal.perform(@user1.id, @person2.id, @status_type, @status.id)
|
||||
end
|
||||
end
|
||||
Loading…
Reference in a new issue