Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #8692 (closed enhancement: fixed)

Opened 1 year ago

Last modified 1 year ago

[PATCH] Increase test coverage of ActionMailer

Reported by: kamal Assigned to: bitsweat
Priority: low Milestone: 1.x
Component: ActionMailer Version: edge
Severity: minor Keywords: test coverage
Cc:

Description

This patch adds additional tests to ActionMailer by:

  1. Testing the custom assert assert_emails works without a block
  2. Using mocha to verify delivery_method via sendmail

Modest increase from 90.4% to 92.0% code coverage. All tests still pass.

Attachments

increase_test_coverage_for_actionmailer.patch (1.8 kB) - added by kamal on 06/20/07 00:40:50.
additional test cases for actionmailer

Change History

06/20/07 00:40:50 changed by kamal

  • attachment increase_test_coverage_for_actionmailer.patch added.

additional test cases for actionmailer

06/20/07 02:09:49 changed by josh

++1

I was trying to get a sendmail mock to work as well. Couldn't get it to test the block.

Very nice.

06/20/07 02:18:21 changed by bitsweat

  • status changed from new to closed.
  • resolution set to incomplete.

Looks good. Please wrap the test method in a uses_mocha block so it runs without the gem installed.

06/20/07 05:08:45 changed by kamal

  • status changed from closed to reopened.
  • resolution deleted.

bitsweat, the entire ActionMailerTest class is already wrapped in uses_mocha. See http://dev.rubyonrails.org/browser/trunk/actionmailer/test/mail_service_test.rb#L257

06/20/07 06:41:35 changed by bitsweat

aha :)

06/20/07 06:50:46 changed by bitsweat

  • status changed from reopened to closed.
  • resolution set to fixed.

(In [7070]) Increase mail delivery test coverage. Closes #8692.

09/21/07 16:06:05 changed by jwarchol

Just a note that this test didn't work for me with mocha 0.4.0, but did when I updated to 0.5.5. So if anyone has such an issue, check your gem version.