aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorDan Gebhardt <dan@cerebris.com>2011-07-16 08:22:43 -0400
committerXavier Noria <fxn@hashref.com>2011-08-13 16:22:18 -0700
commit28daa8bd4bff2c361c3eb35df5c36a532c6ee259 (patch)
tree45ece8ffd75e52cc0551c9340a94c2a2c5ff2848 /actionpack
parentf87b33daaf0f0a93825a3f022d52fcb5aa4c8320 (diff)
downloadrails-28daa8bd4bff2c361c3eb35df5c36a532c6ee259.tar.gz
rails-28daa8bd4bff2c361c3eb35df5c36a532c6ee259.tar.bz2
rails-28daa8bd4bff2c361c3eb35df5c36a532c6ee259.zip
added test case for fix to issue #2094
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/test/template/form_helper_test.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/actionpack/test/template/form_helper_test.rb b/actionpack/test/template/form_helper_test.rb
index cc3d2cddf7..aca2dc9e4d 100644
--- a/actionpack/test/template/form_helper_test.rb
+++ b/actionpack/test/template/form_helper_test.rb
@@ -791,6 +791,23 @@ class FormHelperTest < ActionView::TestCase
assert_dom_equal expected, output_buffer
end
+ def test_form_for_with_remote_in_html
+ form_for(@post, :url => '/', :html => { :remote => true, :id => 'create-post', :method => :put }) do |f|
+ concat f.text_field(:title)
+ concat f.text_area(:body)
+ concat f.check_box(:secret)
+ end
+
+ expected = whole_form("/", "create-post", "edit_post", :method => "put", :remote => true) do
+ "<input name='post[title]' size='30' type='text' id='post_title' value='Hello World' />" +
+ "<textarea name='post[body]' id='post_body' rows='20' cols='40'>Back to the hill and over it again!</textarea>" +
+ "<input name='post[secret]' type='hidden' value='0' />" +
+ "<input name='post[secret]' checked='checked' type='checkbox' id='post_secret' value='1' />"
+ end
+
+ assert_dom_equal expected, output_buffer
+ end
+
def test_form_for_with_remote_without_html
@post.persisted = false
form_for(@post, :remote => true) do |f|