diaspora/spec/models/jobs/mail/mail_mentioned_spec.rb
Dan Hansen f859904c76 change namespace from Mail to Mailers
locally when Resque tried to constantize Jobs::Mail Object.const_get("Jobs") returned our Jobs module but when it tried to const_get("Mail") it returned the Mail gem.
added copyright
2011-10-09 22:41:01 -05:00

21 lines
665 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::Mailers::Mentioned do
describe '#perfom' do
it 'should call .deliver on the notifier object' do
user = alice
sm = Factory(:status_message)
m = Mention.new(:person => user.person, :post=> sm)
mail_mock = mock()
mail_mock.should_receive(:deliver)
Notifier.should_receive(:mentioned).with(user.id, sm.author.id, m.id).and_return(mail_mock)
Jobs::Mailers::Mentioned.perform(user.id, sm.author.id, m.id)
end
end
end