You can do something like this:
def test_mailer
ActionMailer::Base.deliveries = []
assert_equal 1, ActionMailer::Base.deliveries.size
mail = ActionMailer::Base.deliveries[0]
assert_equal "test-J0of1frlU80@public.gmane.org",
mail.to_addrs[0].to_s
assert_match /some regex/, mail.encoded
end
Joe
On May 11, 2005, at 5:37 PM, J.D. Hollis wrote:
> How could I functional test whether a controller action sends an email
> via an ActionMailer?
>
> Cheers,
> J.D.
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>