diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-03-04 13:28:18 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-03-04 13:28:18 +0000 |
commit | 3aaf2b9ed00751d0aa793c98861513ac5302ec10 (patch) | |
tree | d497313144509b6bb0a43c2a10e395424549dcfe /test/test_helper.rb | |
parent | b1d5f42237295895412ff559f3f65a05cd65cf96 (diff) | |
download | redmine-3aaf2b9ed00751d0aa793c98861513ac5302ec10.tar.gz redmine-3aaf2b9ed00751d0aa793c98861513ac5302ec10.zip |
Adds helpers for testing email body.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9086 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/test_helper.rb')
-rw-r--r-- | test/test_helper.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/test_helper.rb b/test/test_helper.rb index a9eedaba9..a02f70f6b 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -158,6 +158,26 @@ class ActiveSupport::TestCase assert s.include?(expected), "\"#{expected}\" not found in \"#{s}\"" end + def assert_not_include(expected, s) + assert !s.include?(expected), "\"#{expected}\" found in \"#{s}\"" + end + + def assert_mail_body_match(expected, mail) + if expected.is_a?(String) + assert_include expected, mail.body + else + assert_match expected, mail.body + end + end + + def assert_mail_body_no_match(expected, mail) + if expected.is_a?(String) + assert_not_include expected, mail.body + else + assert_no_match expected, mail.body + end + end + # Shoulda macros def self.should_render_404 should_respond_with :not_found |