From 7aba81dbe7efc621c15609485cf3f210c02a42f1 Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Fri, 9 Dec 2011 07:15:12 +0000 Subject: [PATCH] Rails3: test: replace deprecated Errors#on to Errors#[] and join with to_s at test/unit/time_entry_activity_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@8136 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/unit/time_entry_activity_test.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/unit/time_entry_activity_test.rb b/test/unit/time_entry_activity_test.rb index 6588e9402..f376dbe25 100644 --- a/test/unit/time_entry_activity_test.rb +++ b/test/unit/time_entry_activity_test.rb @@ -49,7 +49,8 @@ class TimeEntryActivityTest < ActiveSupport::TestCase e = TimeEntryActivity.new(:name => 'Custom Data') assert !e.save - assert_equal I18n.translate('activerecord.errors.messages.invalid'), e.errors.on(:custom_values) + assert_equal I18n.translate('activerecord.errors.messages.invalid'), + e.errors[:custom_values].to_s end def test_create_with_required_custom_field_should_succeed