Permalink
Browse files

added test case for fix to issue #2094

  • Loading branch information...
1 parent c6d83ab commit 455e3212846586eb07cedae2946887583f874204 @dgeb dgeb committed Jul 16, 2011
Showing with 17 additions and 0 deletions.
  1. +17 −0 actionpack/test/template/form_helper_test.rb
View
17 actionpack/test/template/form_helper_test.rb
@@ -791,6 +791,23 @@ def test_form_for_with_remote
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|

0 comments on commit 455e321

Please sign in to comment.