use assert_select instead of include? at "test_register" of unit mailer test

On Rails 3.0.11, token breaks with new line.
So, test fails.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8916 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2012-02-20 14:36:43 +00:00
parent a9161a3fde
commit 5b48e4ae58
1 changed files with 5 additions and 1 deletions

View File

@ -426,7 +426,11 @@ class MailerTest < ActiveSupport::TestCase
ActionMailer::Base.deliveries.clear
assert Mailer.deliver_register(token)
mail = ActionMailer::Base.deliveries.last
assert mail.body.include?("https://redmine.foo/account/activate?token=#{token.value}")
assert_select_email do
assert_select "a[href=?]",
"https://redmine.foo/account/activate?token=#{token.value}",
:text => "https://redmine.foo/account/activate?token=#{token.value}"
end
end
end