On Sat, 2006-12-16 at 07:45 +0100, Daniel McBrearty wrote:
> if you have an action that sends an email, how do you write tests for it?
>
> perhaps print the email to a temp file in test mode? what do you guys do?
>
I am currently considering writing tests for my e-mails too.
You could set __PACKAGE__->config->{email} to "Test" if some env
variable is set, and dump Email::Send::Test->emails to a file in an end
action. Or you could provide a testing action to display (and clear) the
sent e-mails.
I have a similar problem with the values of my captchas.
Btw.: Are there any best practices to hide an action unless in testing
mode? Protect it by an ACL rule if an environment variable is set?
Sébastien
_______________________________________________
List: [email protected]
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/