Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 373
- Log:
Initial import of Radiant 0.9.1, which is now packaged as a gem. This is an
import of the tagged 0.9.1 source checked out from GitHub, which isn't quite
the same as the gem distribution - but it doesn't seem to be available in an
archived form and the installed gem already has modifications, so this is
the closest I can get.
- Author:
- rool
- Date:
- Mon Mar 21 13:40:05 +0000 2011
- Size:
- 1790 Bytes
1 | module ActionMailer |
2 | module TestHelper |
3 | # Asserts that the number of emails sent matches the given number. |
4 | # |
5 | # def test_emails |
6 | # assert_emails 0 |
7 | # ContactMailer.deliver_contact |
8 | # assert_emails 1 |
9 | # ContactMailer.deliver_contact |
10 | # assert_emails 2 |
11 | # end |
12 | # |
13 | # If a block is passed, that block should cause the specified number of emails to be sent. |
14 | # |
15 | # def test_emails_again |
16 | # assert_emails 1 do |
17 | # ContactMailer.deliver_contact |
18 | # end |
19 | # |
20 | # assert_emails 2 do |
21 | # ContactMailer.deliver_contact |
22 | # ContactMailer.deliver_contact |
23 | # end |
24 | # end |
25 | def assert_emails(number) |
26 | if block_given? |
27 | original_count = ActionMailer::Base.deliveries.size |
28 | yield |
29 | new_count = ActionMailer::Base.deliveries.size |
30 | assert_equal original_count + number, new_count, "#{number} emails expected, but #{new_count - original_count} were sent" |
31 | else |
32 | assert_equal number, ActionMailer::Base.deliveries.size |
33 | end |
34 | end |
35 | |
36 | # Assert that no emails have been sent. |
37 | # |
38 | # def test_emails |
39 | # assert_no_emails |
40 | # ContactMailer.deliver_contact |
41 | # assert_emails 1 |
42 | # end |
43 | # |
44 | # If a block is passed, that block should not cause any emails to be sent. |
45 | # |
46 | # def test_emails_again |
47 | # assert_no_emails do |
48 | # # No emails should be sent from this block |
49 | # end |
50 | # end |
51 | # |
52 | # Note: This assertion is simply a shortcut for: |
53 | # |
54 | # assert_emails 0 |
55 | def assert_no_emails(&block) |
56 | assert_emails 0, &block |
57 | end |
58 | end |
59 | end |
60 | |
61 | # TODO: Deprecate this |
62 | module Test |
63 | module Unit |
64 | class TestCase |
65 | include ActionMailer::TestHelper |
66 | end |
67 | end |
68 | end |