aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/template/active_record_helper_test.rb14
-rw-r--r--actionpack/test/template/form_helper_test.rb4
2 files changed, 9 insertions, 9 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
diff --git a/actionpack/test/template/form_helper_test.rb b/actionpack/test/template/form_helper_test.rb
index 947668ccc6..f8215132e3 100644
--- a/actionpack/test/template/form_helper_test.rb
+++ b/actionpack/test/template/form_helper_test.rb
@@ -50,7 +50,7 @@ class FormHelperTest < ActionView::TestCase
@comment = Comment.new
def @post.errors()
Class.new{
- def on(field); "can't be empty" if field == "author_name"; end
+ def [](field); field == "author_name" ? ["can't be empty"] : [] end
def empty?() false end
def count() 1 end
def full_messages() [ "Author name can't be empty" ] end
@@ -1193,4 +1193,4 @@ class FormHelperTest < ActionView::TestCase
def protect_against_forgery?
false
end
-end \ No newline at end of file
+end