Skip to content

Testando ActionMailler

julianalucena edited this page Jan 22, 2011 · 3 revisions
context "Testando ActionMailer" do
    before do
      UserNotifier.delivery_method = :test
      UserNotifier.perform_deliveries = true
      UserNotifier.deliveries = []
    end

    it "sends a e-mail" do
        mail = subject.delivery_something
        UserNotifier.deliveries.size.should == 1
        mail.body.should =~ /name/ 
    end
end

Referência

http://www.rubytutorials.net/2008/02/26/small-rspec-revelations-actionmailer/