views:

10

answers:

0

I am working on the Rails 3 Test cases . While writing case i got Deprecation error like

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)

For that i used errors[:field] instead of errors.on(:field) Now Deprecation error is gone , but cases are not working as earlier it was working . It is not testing any validation for the model

Sol