aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template/form_helper_test.rb
diff options
context:
space:
mode:
authorSam Stephenson <sam@37signals.com>2006-02-08 20:46:15 +0000
committerSam Stephenson <sam@37signals.com>2006-02-08 20:46:15 +0000
commit803b9a41af46210da842afdba032c34109514942 (patch)
tree0ed7d2d1c893fb6c74df9198f8fb3d28e4e3bbd5 /actionpack/test/template/form_helper_test.rb
parent73ed47ddec458a512178de584e896ebb276c0125 (diff)
downloadrails-803b9a41af46210da842afdba032c34109514942.tar.gz
rails-803b9a41af46210da842afdba032c34109514942.tar.bz2
rails-803b9a41af46210da842afdba032c34109514942.zip
Add :html option for specifying form tag options in form_for
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3552 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/template/form_helper_test.rb')
-rw-r--r--actionpack/test/template/form_helper_test.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/actionpack/test/template/form_helper_test.rb b/actionpack/test/template/form_helper_test.rb
index 83d50aae7a..1010598f65 100644
--- a/actionpack/test/template/form_helper_test.rb
+++ b/actionpack/test/template/form_helper_test.rb
@@ -338,4 +338,23 @@ class FormHelperTest < Test::Unit::TestCase
assert_dom_equal expected, _erbout
end
+
+ def test_form_for_with_html_options_adds_options_to_form_tag
+ _erbout = ''
+
+ form_for(:post, @post, :html => {:id => 'some_form', :class => 'some_class'}) do |f| end
+ expected = "<form action=\"http://www.example.com\" class=\"some_class\" id=\"some_form\" method=\"post\"></form>"
+
+ assert_dom_equal expected, _erbout
+ end
+
+ def test_remote_form_for_with_html_options_adds_options_to_form_tag
+ self.extend ActionView::Helpers::PrototypeHelper
+ _erbout = ''
+
+ remote_form_for(:post, @post, :html => {:id => 'some_form', :class => 'some_class'}) do |f| end
+ expected = "<form action=\"http://www.example.com\" class=\"some_class\" id=\"some_form\" method=\"post\" onsubmit=\"new Ajax.Request('http://www.example.com', {asynchronous:true, evalScripts:true, parameters:Form.serialize(this)}); return false;\"></form>"
+
+ assert_dom_equal expected, _erbout
+ end
end