aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template/active_record_helper_test.rb
diff options
context:
space:
mode:
authorEmilio Tagua <miloops@gmail.com>2009-06-23 18:13:46 -0300
committerEmilio Tagua <miloops@gmail.com>2009-06-23 18:13:46 -0300
commitb9088dce07f8525cdb84a1312a77b81db79067d6 (patch)
tree72ace069842b074981ba814ef1c335271176ce27 /actionpack/test/template/active_record_helper_test.rb
parent4864f92ee34e840307d968fa8b04972b6d786fe8 (diff)
parent4417a19b035d73eb46a5e06e296a4b1c8091bef1 (diff)
downloadrails-b9088dce07f8525cdb84a1312a77b81db79067d6.tar.gz
rails-b9088dce07f8525cdb84a1312a77b81db79067d6.tar.bz2
rails-b9088dce07f8525cdb84a1312a77b81db79067d6.zip
Merge commit 'rails/master'
Diffstat (limited to 'actionpack/test/template/active_record_helper_test.rb')
-rw-r--r--actionpack/test/template/active_record_helper_test.rb14
1 files changed, 7 insertions, 7 deletions
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 <em>empty</em>"]
end
- def on(field)
- "can't be <em>empty</em>"
+ def [](field)
+ ["can't be <em>empty</em>"]
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