Rails3: test: replace deprecated Errors#on to Errors#[] and join with to_s at test/unit/version_test.rb

On Rails2, Errors#[] returns single error if one error raises.
But, on Rails3, Errors#[] always returns the array.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8132 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2011-12-09 05:54:13 +00:00
parent 42d2bf0baf
commit c8556330c1
1 changed files with 2 additions and 1 deletions

View File

@ -33,7 +33,8 @@ class VersionTest < ActiveSupport::TestCase
def test_invalid_effective_date_validation
v = Version.new(:project => Project.find(1), :name => '1.1', :effective_date => '99999-01-01')
assert !v.save
assert_equal I18n.translate('activerecord.errors.messages.not_a_date'), v.errors.on(:effective_date)
assert_equal I18n.translate('activerecord.errors.messages.not_a_date'),
v.errors[:effective_date].to_s
end
def test_progress_should_be_0_with_no_assigned_issues