diff options
author | Aditya Sanghi <asanghi@me.com> | 2010-10-02 17:39:12 +0530 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-10-02 17:48:12 +0200 |
commit | 297cf0b26658ff9c7f19fc703de5bd8939e31d06 (patch) | |
tree | 8ae6ffffb4588952784f22d8b5bb643f20f54f42 | |
parent | 8d1df887d32643f0aee2d71f7216ec98fdfe4fdb (diff) | |
download | rails-297cf0b26658ff9c7f19fc703de5bd8939e31d06.tar.gz rails-297cf0b26658ff9c7f19fc703de5bd8939e31d06.tar.bz2 rails-297cf0b26658ff9c7f19fc703de5bd8939e31d06.zip |
added test for form_for with search_field
Signed-off-by: José Valim <jose.valim@gmail.com>
-rw-r--r-- | actionpack/test/template/form_helper_test.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/actionpack/test/template/form_helper_test.rb b/actionpack/test/template/form_helper_test.rb index abc98ebe69..8809e510fb 100644 --- a/actionpack/test/template/form_helper_test.rb +++ b/actionpack/test/template/form_helper_test.rb @@ -761,6 +761,20 @@ class FormHelperTest < ActionView::TestCase assert_dom_equal expected, output_buffer end + + def test_form_for_with_search_field + # Test case for bug which would emit an "object" attribute + # when used with form_for using a search_field form helper + form_for(Post.new, :url => "/search", :html => { :id => 'search-post' }) do |f| + concat f.search_field(:title) + end + + expected = whole_form("/search", "search-post", "new_post") do + "<input name='post[title]' size='30' type='search' id='post_title' />" + end + + assert_dom_equal expected, output_buffer + end def test_form_for_with_remote form_for(@post, :url => '/', :remote => true, :html => { :id => 'create-post', :method => :put }) do |f| @@ -1737,4 +1751,5 @@ class FormHelperTest < ActionView::TestCase def protect_against_forgery? false end + end |