diaspora/spec/models/jobs/mail/reshared_spec.rb
2012-01-21 21:58:50 -08:00

20 lines
710 B
Ruby

# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.
require 'spec_helper'
describe Jobs::Mail::Reshared do
describe '#perfom' do
it 'should call .deliver on the notifier object' do
sm = Factory(:status_message, :author => bob.person, :public => true)
reshare = Factory(:reshare, :author => alice.person, :root=> sm)
mail_mock = mock()
mail_mock.should_receive(:deliver)
Notifier.should_receive(:reshared).with(bob.id, reshare.author.id, reshare.id).and_return(mail_mock)
Jobs::Mail::Reshared.perform(bob.id, reshare.author.id, reshare.id)
end
end
end