我正在使用Rails 3测试用例。在写情况下,我得到了弃用错误,如rails 3测试用例error.on(:field)vs。错误[:field]
DEPRECATION WARNING: Errors#on have been deprecated, use Errors#[] instead.
Also note that the behaviour of Errors#[] has changed. Errors#[] now always returns an Array. An empty Array is returned when there are no errors on the specified attribute. (called from on at /usr/local/lib/ruby/gems/1.9.1/gems/activemodel-3.0.0.rc/lib/active_model/deprecated_error_methods.rb:7)
对于我使用的错误[:现场]代替errors.on(:场) 现在弃用错误消失,但情况并不像早期的工作是工作。这不是模型
测试任何验证索尔
什么是你的问题? – shingara 2010-10-23 11:09:09
问题是errors.on(:field)在rails单元测试中显示deprecation错误和错误[:field]无法正常工作..有没有什么办法可以解决这个问题。 – 2010-10-23 11:26:53