From 85382514f940476184456f660effb5c28cc2cf7a Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Fri, 9 Dec 2011 07:16:21 +0000 Subject: [PATCH] Rails3: test: replace deprecated Errors#on to Errors#[] and join with to_s at test/unit/issue_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@8138 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/unit/issue_test.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/unit/issue_test.rb b/test/unit/issue_test.rb index b2e243835..f973d32ce 100644 --- a/test/unit/issue_test.rb +++ b/test/unit/issue_test.rb @@ -56,15 +56,18 @@ class IssueTest < ActiveSupport::TestCase assert issue.available_custom_fields.include?(field) # No value for the custom field assert !issue.save - assert_equal I18n.translate('activerecord.errors.messages.invalid'), issue.errors.on(:custom_values) + assert_equal I18n.translate('activerecord.errors.messages.invalid'), + issue.errors[:custom_values].to_s # Blank value issue.custom_field_values = { field.id => '' } assert !issue.save - assert_equal I18n.translate('activerecord.errors.messages.invalid'), issue.errors.on(:custom_values) + assert_equal I18n.translate('activerecord.errors.messages.invalid'), + issue.errors[:custom_values].to_s # Invalid value issue.custom_field_values = { field.id => 'SQLServer' } assert !issue.save - assert_equal I18n.translate('activerecord.errors.messages.invalid'), issue.errors.on(:custom_values) + assert_equal I18n.translate('activerecord.errors.messages.invalid'), + issue.errors[:custom_values].to_s # Valid value issue.custom_field_values = { field.id => 'PostgreSQL' } assert issue.save