aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2011-07-26 13:50:20 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2011-07-26 13:50:20 -0700
commitef89a70540f09e4c454e05a3c9ae0824884ad967 (patch)
treeb0d573e04ee95770e02c38b464b6805f4457ece3 /actionpack/test
parentd482cf8bfa941b76cce2ae2b60158573615a7d16 (diff)
parent455e3212846586eb07cedae2946887583f874204 (diff)
downloadrails-ef89a70540f09e4c454e05a3c9ae0824884ad967.tar.gz
rails-ef89a70540f09e4c454e05a3c9ae0824884ad967.tar.bz2
rails-ef89a70540f09e4c454e05a3c9ae0824884ad967.zip
Merge pull request #2095 from dgeb/issue-2094
Fixes overriding of options[:html][:remote] in form_for() (Issue #2094)
Diffstat (limited to 'actionpack/test')
-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|