[rspec-users] Cucumber - Testing ActionMailer

Brandt Kurowski brandtkurowski at gmail.com
Sat May 2 23:54:42 EDT 2009

On Apr 29, 10:37 am, Ben Mabey <b... at benmabey.com> wrote:
> However, that is not done yet.  As it stands now you
> have two options: a) have the test execution and script in the same
> process or b) Use ARMailer[1] in your testing environment.  ARMailer
> places the messages in a database for queuing.  So instead of checking
> the in-memory array EmailSpec will check the queue on the database.  
> Since this is just for testing then you could use a lightweight sqlite3
> db to store this.

For what it's worth, I believe that ARMailer requires you to change
your base class for mailers from ActionMailer::Base to
ActionMailer::ARMailer, which makes it difficult to use ARMailer only
in your test environment. However, the adzap-ar_mailer[1] fork
supports using the ActionMailer::Base base class, which makes it easy
to use ARMailer only for testing (by specifying it in config/
environments/test.rb) while using another delivery mechanism for

1. http://github.com/adzap/ar_mailer/tree/master

More information about the rspec-users mailing list