ActionMailer integration + Test environment

Samuel Wong's Avatar

Samuel Wong

29 Dec, 2011 11:58 PM via web

I'm using ActionMailer integration as per the docs. My email gets sent just fine in development and production. But what about the testing environment? What do folks do for automated testing with Postageapp?

Thanks.

  1. 2 Posted by Samuel Wong on 30 Dec, 2011 12:00 AM

    Samuel Wong's Avatar

    I should mention I'm on Rails 3.1 and I use RSpec 2 for testing.

  2. Support Staff 3 Posted by Tom Walsham on 30 Dec, 2011 01:58 AM

    Tom Walsham's Avatar

    Hey Samuel,

    Thanks for using PostageApp!

    Unfortunately, I am not equipped to answer your question properly, so I have asked one of the developers to take a look and/or give me an answer to pass along to you.

    Hope that's alright with you, will get back to you as soon as I hear back. Thanks again!

  3. 4 Posted by Samuel Wong on 02 Jan, 2012 05:45 PM

    Samuel Wong's Avatar

    Great, thanks Jon. I look forward to hearing back from you.

  4. 5 Posted by Oleg on 03 Jan, 2012 02:58 PM

    Oleg's Avatar

    Hi Samuel,

    You should be able to test PostageApp::Mailer emails just like you would ActionMailer ones. So last_delivery = ActionMailer::Base.deliveries.last will return a PostageApp::Request object that should respond to your standard title, to, body, headers, etc ... If you want to directly test API payload look at last_delivery.arguments_to_send.

    Hope this helps.
    Oleg

Reply to this discussion

Internal reply

Formatting help or Preview

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.