Skip to content

Instantly share code, notes, and snippets.

@phiggins
Created March 12, 2010 21:01
Show Gist options
  • Save phiggins/330794 to your computer and use it in GitHub Desktop.
Save phiggins/330794 to your computer and use it in GitHub Desktop.
# comment for blog post:
# http://lucidcode.co.nz/blog/archives/2010/03/02/testing-email-delivery-in-rails-with-gmail-httparty/
it "sends a notification email after the model is created" do
subject = "email notification test #{Time.now}"
flexmock( Model ).new_instances.should_receive( :subject => subject )
create_model_successfully
notify = nil
10.times do
sleep 0.1
notify = Gmail.inbox("username").first["title"] rescue nil
end
notify.should == subject
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment