diff options
author | José Valim <jose.valim@gmail.com> | 2011-05-15 15:51:20 -0700 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-05-15 15:51:20 -0700 |
commit | 6e581cce1c1116d71484a5a4a5f92f0ea6fd29e4 (patch) | |
tree | 82b5adaf04e54bf03fd5f51963c7dccc58928729 /actionpack/test/template/form_helper_test.rb | |
parent | dde82a44d702f8416905476bbea5842157d6a508 (diff) | |
parent | 82f33dce9c6229bee35af35a9aa3bc9c144737f3 (diff) | |
download | rails-6e581cce1c1116d71484a5a4a5f92f0ea6fd29e4.tar.gz rails-6e581cce1c1116d71484a5a4a5f92f0ea6fd29e4.tar.bz2 rails-6e581cce1c1116d71484a5a4a5f92f0ea6fd29e4.zip |
Merge pull request #568 from carlosantoniodasilva/fields_for_fixes
Fields for fixes for non nested attributes and without object
Diffstat (limited to 'actionpack/test/template/form_helper_test.rb')
-rw-r--r-- | actionpack/test/template/form_helper_test.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/actionpack/test/template/form_helper_test.rb b/actionpack/test/template/form_helper_test.rb index c25c850eb3..286bfb4d04 100644 --- a/actionpack/test/template/form_helper_test.rb +++ b/actionpack/test/template/form_helper_test.rb @@ -1725,6 +1725,20 @@ class FormHelperTest < ActionView::TestCase assert_dom_equal expected, output_buffer end + def test_form_for_and_fields_for_with_non_nested_association_and_without_object + form_for(@post) do |f| + concat f.fields_for(:category) { |c| + concat c.text_field(:name) + } + end + + expected = whole_form('/posts/123', 'edit_post_123', 'edit_post', 'put') do + "<input name='post[category][name]' type='text' size='30' id='post_category_name' />" + end + + assert_dom_equal expected, output_buffer + end + class LabelledFormBuilder < ActionView::Helpers::FormBuilder (field_helpers - %w(hidden_field)).each do |selector| class_eval <<-RUBY_EVAL, __FILE__, __LINE__ + 1 |