Skip to content

Instantly share code, notes, and snippets.

@phiggins phiggins/gist:330794
Created Mar 12, 2010

Embed
What would you like to do?
# 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
You can’t perform that action at this time.