[rspec-users] "Tricks" for testing after_create callback???

Pat Maddox pergesu at gmail.com
Thu Dec 13 10:06:28 EST 2007

On Dec 13, 2007 4:57 AM, Rick DeNatale <rick.denatale at gmail.com> wrote:
> On 12/12/07, Pat Maddox <pergesu at gmail.com> wrote:
> > I would not mock the call, and would instead just let the mailer do
> > its thing.  You can verify that a message was sent, match the
> > subject/content, etc.  It's very lightweight so there's no reason not
> > to use it.
> The problem with this is that it combines testing the sending of the
> message with testing how it's rendered.
> I prefer to do the latter in the context of testing the mailer.

So then I would write two specs.  One verifies that it was sent, and
one verifies the content.  You're combining them here as well, albeit
in a less flexible (and apparently painful :) way.


More information about the rspec-users mailing list