Created
March 12, 2010 21:01
-
-
Save phiggins/330794 to your computer and use it in GitHub Desktop.
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
# 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