Created
August 14, 2010 15:26
-
-
Save dgalarza/524404 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
describe Notifications, :type => :helper do #setting type is necessary | |
before(:each) do | |
ActionMailer::Base.delivery_method = :test | |
ActionMailer::Base.perform_deliveries = true | |
ActionMailer::Base.deliveries = [] | |
end | |
it “should sent a nice email with the analyses to the user” do | |
analysis_observer = AnalysisObserver.instance | |
# Stub out the after create observation | |
analysis_observer.stub!(:after_create) | |
mail = Notifications.deliver_analyses_to_user “[email protected]”, Factory(:temporary_user, :analyses =>[Factory(:analysis)]) | |
# Check to see that the email was added to the queue for sending | |
ActionMailer::Base.deliveries.size.should == 1 | |
# Could also verify contents of the email | |
# mail.body.should have_tag(”img”, 3) | |
# mail.body.should have_tag(”table”) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment