diff options
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 |