Do not do assertions on mail class.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8991 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2012-02-25 09:58:23 +00:00
parent f1b26008b8
commit 28503d83cb
6 changed files with 10 additions and 10 deletions

View File

@ -85,7 +85,7 @@ class AdminControllerTest < ActionController::TestCase
get :test_email get :test_email
assert_redirected_to '/settings/edit?tab=notifications' assert_redirected_to '/settings/edit?tab=notifications'
mail = ActionMailer::Base.deliveries.last mail = ActionMailer::Base.deliveries.last
assert_kind_of TMail::Mail, mail assert_not_nil mail
user = User.find(1) user = User.find(1)
assert_equal [user.mail], mail.bcc assert_equal [user.mail], mail.bcc
end end

View File

@ -72,7 +72,7 @@ class FilesControllerTest < ActionController::TestCase
assert_equal Project.find(1), a.container assert_equal Project.find(1), a.container
mail = ActionMailer::Base.deliveries.last mail = ActionMailer::Base.deliveries.last
assert_kind_of TMail::Mail, mail assert_not_nil mail
assert_equal "[eCookbook] New file", mail.subject assert_equal "[eCookbook] New file", mail.subject
assert mail.body.include?('testfile.txt') assert mail.body.include?('testfile.txt')
end end

View File

@ -1525,7 +1525,7 @@ class IssuesControllerTest < ActionController::TestCase
assert issue.watched_by?(User.find(3)) assert issue.watched_by?(User.find(3))
# Watchers notified # Watchers notified
mail = ActionMailer::Base.deliveries.last mail = ActionMailer::Base.deliveries.last
assert_kind_of TMail::Mail, mail assert_not_nil mail
assert [mail.bcc, mail.cc].flatten.include?(User.find(3).mail) assert [mail.bcc, mail.cc].flatten.include?(User.find(3).mail)
end end
@ -2166,7 +2166,7 @@ class IssuesControllerTest < ActionController::TestCase
assert_equal '125', issue.custom_value_for(2).value assert_equal '125', issue.custom_value_for(2).value
mail = ActionMailer::Base.deliveries.last mail = ActionMailer::Base.deliveries.last
assert_kind_of TMail::Mail, mail assert_not_nil mail
assert mail.subject.starts_with?("[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}]") 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.include?("Subject changed from #{old_subject} to #{new_subject}")
end end
@ -2241,7 +2241,7 @@ class IssuesControllerTest < ActionController::TestCase
assert_equal 'New custom value', issue.custom_value_for(2).value assert_equal 'New custom value', issue.custom_value_for(2).value
mail = ActionMailer::Base.deliveries.last mail = ActionMailer::Base.deliveries.last
assert_kind_of TMail::Mail, mail assert_not_nil mail
assert mail.body.include?("Searchable field changed from 125 to New custom value") assert mail.body.include?("Searchable field changed from 125 to New custom value")
end end

View File

@ -104,7 +104,7 @@ class MessagesControllerTest < ActionController::TestCase
assert_equal 1, message.board_id assert_equal 1, message.board_id
mail = ActionMailer::Base.deliveries.last mail = ActionMailer::Base.deliveries.last
assert_kind_of TMail::Mail, mail assert_not_nil mail
assert_equal "[#{message.board.project.name} - #{message.board.name} - msg#{message.root.id}] Test created message", mail.subject assert_equal "[#{message.board.project.name} - #{message.board.name} - msg#{message.root.id}] Test created message", mail.subject
assert mail.body.include?('Message body') assert mail.body.include?('Message body')
# author # author

View File

@ -43,7 +43,7 @@ class MailerTest < ActiveSupport::TestCase
assert Mailer.deliver_issue_edit(journal) assert Mailer.deliver_issue_edit(journal)
mail = ActionMailer::Base.deliveries.last mail = ActionMailer::Base.deliveries.last
assert_kind_of TMail::Mail, mail assert_not_nil mail
assert_select_email do assert_select_email do
# link to the main ticket # link to the main ticket
@ -73,7 +73,7 @@ class MailerTest < ActiveSupport::TestCase
assert Mailer.deliver_issue_edit(journal) assert Mailer.deliver_issue_edit(journal)
mail = ActionMailer::Base.deliveries.last mail = ActionMailer::Base.deliveries.last
assert_kind_of TMail::Mail, mail assert_not_nil mail
assert_select_email do assert_select_email do
# link to the main ticket # link to the main ticket
@ -106,7 +106,7 @@ class MailerTest < ActiveSupport::TestCase
assert Mailer.deliver_issue_edit(journal) assert Mailer.deliver_issue_edit(journal)
mail = ActionMailer::Base.deliveries.last mail = ActionMailer::Base.deliveries.last
assert_kind_of TMail::Mail, mail assert_not_nil mail
assert_select_email do assert_select_email do
# link to the main ticket # link to the main ticket

View File

@ -173,7 +173,7 @@ class RepositoryTest < ActiveSupport::TestCase
# 2 email notifications # 2 email notifications
assert_equal 2, ActionMailer::Base.deliveries.size assert_equal 2, ActionMailer::Base.deliveries.size
mail = ActionMailer::Base.deliveries.first mail = ActionMailer::Base.deliveries.first
assert_kind_of TMail::Mail, mail assert_not_nil mail
assert mail.subject.starts_with?( assert mail.subject.starts_with?(
"[#{fixed_issue.project.name} - #{fixed_issue.tracker.name} ##{fixed_issue.id}]") "[#{fixed_issue.project.name} - #{fixed_issue.tracker.name} ##{fixed_issue.id}]")
assert mail.body.include?( assert mail.body.include?(