aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorNicholas Seckar <nseckar@gmail.com>2006-02-11 23:29:53 +0000
committerNicholas Seckar <nseckar@gmail.com>2006-02-11 23:29:53 +0000
commit344ae8326a51beabbc5b3f4f851c3d65ec789e2d (patch)
tree9e017c6dac888f0ad5d76d7b16bf34691816cdd7 /actionpack/test
parent91cdd59b12d4101c3dc1130cf0f2b4543a14eb79 (diff)
downloadrails-344ae8326a51beabbc5b3f4f851c3d65ec789e2d.tar.gz
rails-344ae8326a51beabbc5b3f4f851c3d65ec789e2d.tar.bz2
rails-344ae8326a51beabbc5b3f4f851c3d65ec789e2d.zip
Remove over-engineered form_for code for a leaner implementation.
Document form_for's :html option. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3572 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/template/form_helper_test.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/actionpack/test/template/form_helper_test.rb b/actionpack/test/template/form_helper_test.rb
index 1010598f65..20c90ea832 100644
--- a/actionpack/test/template/form_helper_test.rb
+++ b/actionpack/test/template/form_helper_test.rb
@@ -268,7 +268,7 @@ class FormHelperTest < Test::Unit::TestCase
assert_dom_equal expected, _erbout
end
- class LabellingBulider < ActionView::Helpers::FormBuilder
+ class LabelledFormBuilder < ActionView::Helpers::FormBuilder
(field_helpers - %w(hidden_field)).each do |selector|
src = <<-END_SRC
def #{selector}(field, *args, &proc)
@@ -282,7 +282,7 @@ class FormHelperTest < Test::Unit::TestCase
def test_form_for_with_labelled_builder
_erbout = ''
- form_for(:post, @post, :builder => LabellingBulider) do |f|
+ form_for(:post, @post, :builder => LabelledFormBuilder) do |f|
_erbout.concat f.text_field(:title)
_erbout.concat f.text_area(:body)
_erbout.concat f.check_box(:secret)
@@ -304,7 +304,7 @@ class FormHelperTest < Test::Unit::TestCase
self.extend ActionView::Helpers::PrototypeHelper
_erbout = ''
- remote_form_for(:post, @post, :builder => LabellingBulider) do |f|
+ remote_form_for(:post, @post, :builder => LabelledFormBuilder) do |f|
_erbout.concat f.text_field(:title)
_erbout.concat f.text_area(:body)
_erbout.concat f.check_box(:secret)
@@ -323,19 +323,19 @@ class FormHelperTest < Test::Unit::TestCase
def test_fields_for_with_labelled_builder
_erbout = ''
-
- fields_for(:post, @post, :builder => LabellingBulider) do |f|
+
+ fields_for(:post, @post, :builder => LabelledFormBuilder) do |f|
_erbout.concat f.text_field(:title)
_erbout.concat f.text_area(:body)
_erbout.concat f.check_box(:secret)
end
-
+
expected =
"<label for='title'>Title:</label> <input name='post[title]' size='30' type='text' id='post_title' value='Hello World' /><br/>" +
"<label for='body'>Body:</label> <textarea name='post[body]' id='post_body' rows='20' cols='40'>Back to the hill and over it again!</textarea><br/>" +
"<label for='secret'>Secret:</label> <input name='post[secret]' checked='checked' type='checkbox' id='post_secret' value='1' />" +
"<input name='post[secret]' type='hidden' value='0' /><br/>"
-
+
assert_dom_equal expected, _erbout
end