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
This commit is contained in:
parent
8e5242ef63
commit
85382514f9
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue