[rspec-users] how to write a spec for an actionmailer method

Salil Gaikwad lists at ruby-forum.com
Tue Apr 14 10:11:22 EDT 2009


> http://github.com/bmabey/email-spec/blob/cdf3eeda4d28ef8b35bbce8af9ca7c493528332d/examples/rails_root/spec/models/user_mailer_spec.rb
> 
> -Ben

I try following and it works. i don't know how but it pass the test 
gives me 100% coverage and also i receive a test email.

describe ApplicationHelper do
   it "should use ActionMailer to send a confirmation email" do
      ActionMailer::Base.deliveries=[]
      Notifier.deliver_conta('Salil','salil at cipher-tech.com', 123456)
   end
end

-- 
Posted via http://www.ruby-forum.com/.


More information about the rspec-users mailing list