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:
@@ -2164,7 +2164,7 @@ class IssuesControllerTest < ActionController::TestCase
|
||||
mail = ActionMailer::Base.deliveries.last
|
||||
assert_not_nil mail
|
||||
assert mail.subject.starts_with?("[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}]")
|
||||
assert mail.body.include?("Subject changed from #{old_subject} to #{new_subject}")
|
||||
assert_mail_body_match "Subject changed from #{old_subject} to #{new_subject}", mail
|
||||
end
|
||||
|
||||
def test_put_update_with_project_change
|
||||
@@ -2190,7 +2190,7 @@ class IssuesControllerTest < ActionController::TestCase
|
||||
mail = ActionMailer::Base.deliveries.last
|
||||
assert_not_nil mail
|
||||
assert mail.subject.starts_with?("[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}]")
|
||||
assert mail.body.include?("Project changed from eCookbook to OnlineStore")
|
||||
assert_mail_body_match "Project changed from eCookbook to OnlineStore", mail
|
||||
end
|
||||
|
||||
def test_put_update_with_tracker_change
|
||||
@@ -2215,7 +2215,7 @@ class IssuesControllerTest < ActionController::TestCase
|
||||
mail = ActionMailer::Base.deliveries.last
|
||||
assert_not_nil mail
|
||||
assert mail.subject.starts_with?("[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}]")
|
||||
assert mail.body.include?("Tracker changed from Bug to Feature request")
|
||||
assert_mail_body_match "Tracker changed from Bug to Feature request", mail
|
||||
end
|
||||
|
||||
def test_put_update_with_custom_field_change
|
||||
@@ -2238,7 +2238,7 @@ class IssuesControllerTest < ActionController::TestCase
|
||||
|
||||
mail = ActionMailer::Base.deliveries.last
|
||||
assert_not_nil mail
|
||||
assert mail.body.include?("Searchable field changed from 125 to New custom value")
|
||||
assert_mail_body_match "Searchable field changed from 125 to New custom value", mail
|
||||
end
|
||||
|
||||
def test_put_update_with_multi_custom_field_change
|
||||
@@ -2281,7 +2281,7 @@ class IssuesControllerTest < ActionController::TestCase
|
||||
assert_equal 2, j.details.size
|
||||
|
||||
mail = ActionMailer::Base.deliveries.last
|
||||
assert mail.body.include?("Status changed from New to Assigned")
|
||||
assert_mail_body_match "Status changed from New to Assigned", mail
|
||||
# subject should contain the new status
|
||||
assert mail.subject.include?("(#{ IssueStatus.find(2).name })")
|
||||
end
|
||||
@@ -2299,7 +2299,7 @@ class IssuesControllerTest < ActionController::TestCase
|
||||
assert_equal User.anonymous, j.user
|
||||
|
||||
mail = ActionMailer::Base.deliveries.last
|
||||
assert mail.body.include?(notes)
|
||||
assert_mail_body_match notes, mail
|
||||
end
|
||||
|
||||
def test_put_update_with_note_and_spent_time
|
||||
@@ -2357,7 +2357,7 @@ class IssuesControllerTest < ActionController::TestCase
|
||||
assert_equal 59, File.size(attachment.diskfile)
|
||||
|
||||
mail = ActionMailer::Base.deliveries.last
|
||||
assert mail.body.include?('testfile.txt')
|
||||
assert_mail_body_match 'testfile.txt', mail
|
||||
end
|
||||
|
||||
def test_put_update_with_failure_should_save_attachments
|
||||
|
||||
Reference in New Issue
Block a user