Adds helpers for testing email body.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9086 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
1 parent
b1d5f42237
commit
3aaf2b9ed0
7 files changed
+38
-18
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user