Created
June 17, 2011 09:46
-
-
Save thechrisoshow/1031144 to your computer and use it in GitHub Desktop.
Testing email delivery in Rails 3 vs Rails 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Using rspec mocking: | |
# Rails 2 method: | |
UserMailer.should_receive(:deliver_signup) | |
# Cumbersome Rails 3 method: | |
mailer = mock | |
mailer.should_receive(:deliver) | |
UserMailer.should_receive(:signup).and_return(mailer) |
Woops, should've said and_return.
Did that fix it for ya?
Yessir
…On Aug 16, 2011, at 3:36 AM, thechrisoshow ***@***.*** wrote:
Woops, should've said and_return.
Did that fix it for ya?
##
Reply to this email directly or view it on GitHub:
https://gist.github.com/1031144
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This doesn't work.