Skip to content

Instantly share code, notes, and snippets.

@releu
Forked from thechrisoshow/mailer_spec.rb
Created April 26, 2012 15:40
Show Gist options
  • Save releu/2500453 to your computer and use it in GitHub Desktop.
Save releu/2500453 to your computer and use it in GitHub Desktop.
Testing email delivery in Rails 3
it 'should send confirmation email' do
review = build(:review)
mailer = mock; mailer.should_receive(:deliver)
ReviewMailer.should_receive(:confirmation).with(review).and_return(mailer)
review.save
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment