How to test sending mails in model

Hi all, I have this model (see the attachment). I has an after_save filter which sends mail. But I don't know how to test it. Most things I find about testing the sending of e-mails is about the ActionMailer class.

Does anyone know how I can test this method properly (send_mail_about_new_deposit)?

Thanks in advance!

Attachments: http://www.ruby-forum.com/attachment/1245/deposit.rb

we use ActionMailer very often, but normally do only this simple test:

first: ActionMailer::Base.deliveries.clear

then create/save the deposit and with: assert_equal(1, ActionMailer::Base.deliveries.length)

make sure, that the mail was sent

Thorsten Mueller wrote:

we use ActionMailer very often, but normally do only this simple test:

first: ActionMailer::Base.deliveries.clear

then create/save the deposit and with: assert_equal(1, ActionMailer::Base.deliveries.length)

make sure, that the mail was sent

Ah thanks! Looks very simple and is exactly what I want.