Skip to content

Instantly share code, notes, and snippets.

@thechrisoshow
Created June 17, 2011 09:46
Show Gist options
  • Save thechrisoshow/1031144 to your computer and use it in GitHub Desktop.
Save thechrisoshow/1031144 to your computer and use it in GitHub Desktop.
Testing email delivery in Rails 3 vs Rails 2
# 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)
@maletor
Copy link

maletor commented Aug 16, 2011 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment