From 5267addd4f986c89df3d31f35e046abc3b1fbe26 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Wed, 17 Jun 2009 19:37:08 -0700 Subject: Use errors[field] instead of errors.on(field) --- actionpack/test/template/active_record_helper_test.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'actionpack/test/template/active_record_helper_test.rb') diff --git a/actionpack/test/template/active_record_helper_test.rb b/actionpack/test/template/active_record_helper_test.rb index b4b8cbe074..4691049a41 100644 --- a/actionpack/test/template/active_record_helper_test.rb +++ b/actionpack/test/template/active_record_helper_test.rb @@ -33,8 +33,8 @@ class ActiveRecordHelperTest < ActionView::TestCase ["Author name can't be empty"] end - def on(field) - "can't be empty" + def [](field) + ["can't be empty"] end end @@ -47,14 +47,14 @@ class ActiveRecordHelperTest < ActionView::TestCase @post = Post.new def @post.errors Class.new { - def on(field) + def [](field) case field.to_s when "author_name" - "can't be empty" + ["can't be empty"] when "body" - true + ['foo'] else - false + [] end end def empty?() false end @@ -85,7 +85,7 @@ class ActiveRecordHelperTest < ActionView::TestCase @user = User.new def @user.errors Class.new { - def on(field) field == "email" end + def [](field) field == "email" ? ['nonempty'] : [] end def empty?() false end def count() 1 end def full_messages() [ "User email can't be empty" ] end -- cgit v1.2.3