aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorwycats <wycats@gmail.com>2010-03-27 03:09:33 -0700
committerwycats <wycats@gmail.com>2010-03-27 03:10:05 -0700
commit0a352056a4055c170e62a521267f5bc51c6659a0 (patch)
tree9fc6cd75ae449d1d976e0b6b61126b7ca1df7645 /actionpack/test
parent418e5fc279b19c0d35d3f2b6b5ce216a566c8fc2 (diff)
downloadrails-0a352056a4055c170e62a521267f5bc51c6659a0.tar.gz
rails-0a352056a4055c170e62a521267f5bc51c6659a0.tar.bz2
rails-0a352056a4055c170e62a521267f5bc51c6659a0.zip
Fixes a bug where error_messages_for was returning an empty div [#4048 state:resolved] (ht: Geoff Garside)
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/template/active_model_helper_test.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/actionpack/test/template/active_model_helper_test.rb b/actionpack/test/template/active_model_helper_test.rb
index 71c7d5b621..7a665b00bc 100644
--- a/actionpack/test/template/active_model_helper_test.rb
+++ b/actionpack/test/template/active_model_helper_test.rb
@@ -266,6 +266,10 @@ class ActiveModelHelperTest < ActionView::TestCase
assert_dom_equal "<div class=\"differentError\">beforecan't be emptyafter</div>", error_message_on(:post, :author_name, :css_class => 'differentError', :prepend_text => 'before', :append_text => 'after')
end
+ def test_error_message_on_handles_empty_errors
+ assert_equal "", error_message_on(@post, :tag)
+ end
+
def test_error_messages_for_many_objects
assert_dom_equal %(<div class="errorExplanation" id="errorExplanation"><h2>2 errors prohibited this post from being saved</h2><p>There were problems with the following fields:</p><ul><li>Author name can't be empty</li><li>User email can't be empty</li></ul></div>), error_messages_for("post", "user")