|
|
@ -45,8 +45,8 @@ describe DeliverWatcherNotificationJob, type: :model do |
|
|
|
|
|
|
|
|
|
|
|
before do |
|
|
|
before do |
|
|
|
# make sure no actual calls make it into the UserMailer |
|
|
|
# make sure no actual calls make it into the UserMailer |
|
|
|
allow(UserMailer).to receive(:work_package_watcher_added).and_return(double('mail', |
|
|
|
allow(UserMailer).to receive(:work_package_watcher_added) |
|
|
|
deliver: nil)) |
|
|
|
.and_return(double('mail', deliver_now: nil)) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
it 'sends a mail' do |
|
|
|
it 'sends a mail' do |
|
|
@ -60,7 +60,7 @@ describe DeliverWatcherNotificationJob, type: :model do |
|
|
|
describe 'exceptions should be raised' do |
|
|
|
describe 'exceptions should be raised' do |
|
|
|
before do |
|
|
|
before do |
|
|
|
mail = double('mail') |
|
|
|
mail = double('mail') |
|
|
|
allow(mail).to receive(:deliver).and_raise(SocketError) |
|
|
|
allow(mail).to receive(:deliver_now).and_raise(SocketError) |
|
|
|
expect(UserMailer).to receive(:work_package_watcher_added).and_return(mail) |
|
|
|
expect(UserMailer).to receive(:work_package_watcher_added).and_return(mail) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|