From 3da608e0b48b44d695d4727c3dc2a8022fdbddd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Fri, 1 Jul 2011 14:51:34 -0300 Subject: Revert "Add method fields_for_with_index to FormHelper" This reverts commit 7c562d5e460d97b18e4f3367b3cfb13401732920. Conflicts: actionpack/lib/action_view/helpers/form_helper.rb --- actionpack/test/template/form_helper_test.rb | 125 --------------------------- 1 file changed, 125 deletions(-) (limited to 'actionpack/test/template') diff --git a/actionpack/test/template/form_helper_test.rb b/actionpack/test/template/form_helper_test.rb index bf65a9359b..cc3d2cddf7 100644 --- a/actionpack/test/template/form_helper_test.rb +++ b/actionpack/test/template/form_helper_test.rb @@ -974,22 +974,6 @@ class FormHelperTest < ActionView::TestCase assert_dom_equal expected, output_buffer end - def test_nested_fields_for_with_index_with_index_and_parent_fields - form_for(@post, :index => 1) do |c| - concat c.text_field(:title) - concat c.fields_for_with_index('comment', @comment, :index => 1) { |r, comment_index| - concat r.text_field(:name, "data-index" => comment_index) - } - end - - expected = whole_form('/posts/123', 'edit_post_123', 'edit_post', 'put') do - "" + - "" - end - - assert_dom_equal expected, output_buffer - end - def test_form_for_with_index_and_nested_fields_for output_buffer = form_for(@post, :index => 1) do |f| concat f.fields_for(:comment, @post) { |c| @@ -1046,20 +1030,6 @@ class FormHelperTest < ActionView::TestCase assert_dom_equal expected, output_buffer end - def test_nested_fields_for_with_index_with_index_radio_button - form_for(@post) do |f| - concat f.fields_for_with_index(:comment, @post, :index => 5) { |c, index| - concat c.radio_button(:title, "hello", "data-index" => index) - } - end - - expected = whole_form('/posts/123', 'edit_post_123', 'edit_post', 'put') do - "" - end - - assert_dom_equal expected, output_buffer - end - def test_nested_fields_for_with_auto_index_on_both form_for(@post, :as => "post[]") do |f| concat f.fields_for("comment[]", @post) { |c| @@ -1259,29 +1229,6 @@ class FormHelperTest < ActionView::TestCase assert_dom_equal expected, output_buffer end - def test_nested_fields_for_with_index_with_existing_records_on_a_nested_attributes_collection_association - @post.comments = Array.new(2) { |id| Comment.new(id + 1) } - - form_for(@post) do |f| - concat f.text_field(:title) - @post.comments.each do |comment| - concat f.fields_for_with_index(:comments, comment) { |cf, index| - concat cf.text_field(:name, "data-index" => index) - } - end - end - - expected = whole_form('/posts/123', 'edit_post_123', 'edit_post', :method => 'put') do - '' + - '' + - '' + - '' + - '' - end - - assert_dom_equal expected, output_buffer - end - def test_nested_fields_for_with_existing_records_on_a_nested_attributes_collection_association_with_disabled_hidden_id @post.comments = Array.new(2) { |id| Comment.new(id + 1) } @post.author = Author.new(321) @@ -1309,33 +1256,6 @@ class FormHelperTest < ActionView::TestCase assert_dom_equal expected, output_buffer end - def test_nested_fields_for_with_index_with_existing_records_on_a_nested_attributes_collection_association_with_disabled_hidden_id - @post.comments = Array.new(2) { |id| Comment.new(id + 1) } - @post.author = Author.new(321) - - form_for(@post) do |f| - concat f.text_field(:title) - concat f.fields_for(:author) { |af| - concat af.text_field(:name) - } - @post.comments.each do |comment| - concat f.fields_for_with_index(:comments, comment, :include_id => false) { |cf, index| - concat cf.text_field(:name, 'data-index' => index) - } - end - end - - expected = whole_form('/posts/123', 'edit_post_123', 'edit_post', :method => 'put') do - '' + - '' + - '' + - '' + - '' - end - - assert_dom_equal expected, output_buffer - end - def test_nested_fields_for_with_existing_records_on_a_nested_attributes_collection_association_with_disabled_hidden_id_inherited @post.comments = Array.new(2) { |id| Comment.new(id + 1) } @post.author = Author.new(321) @@ -1457,28 +1377,6 @@ class FormHelperTest < ActionView::TestCase assert_dom_equal expected, output_buffer end - def test_nested_fields_for_with_index_with_new_records_on_a_nested_attributes_collection_association - @post.comments = [Comment.new, Comment.new] - - form_for(@post) do |f| - concat f.text_field(:title) - @post.comments.each do |comment| - concat f.fields_for_with_index(:comments, comment) { |cf, index| - concat cf.text_field(:name, "data-index" => index) - } - end - end - - expected = whole_form('/posts/123', 'edit_post_123', 'edit_post', :method => 'put') do - '' + - '' + - '' - end - - assert_dom_equal expected, output_buffer - end - - def test_nested_fields_for_with_existing_and_new_records_on_a_nested_attributes_collection_association @post.comments = [Comment.new(321), Comment.new] @@ -1501,29 +1399,6 @@ class FormHelperTest < ActionView::TestCase assert_dom_equal expected, output_buffer end - def test_nested_fields_for_with_index_with_existing_and_new_records_on_a_nested_attributes_collection_association - @post.comments = [Comment.new(321), Comment.new] - - form_for(@post) do |f| - concat f.text_field(:title) - @post.comments.each do |comment| - concat f.fields_for_with_index(:comments, comment) { |cf, index| - concat cf.text_field(:name, "data-index" => index) - } - end - end - - expected = whole_form('/posts/123', 'edit_post_123', 'edit_post', :method => 'put') do - '' + - '' + - '' + - '' - end - - assert_dom_equal expected, output_buffer - end - - def test_nested_fields_for_with_an_empty_supplied_attributes_collection form_for(@post) do |f| concat f.text_field(:title) -- cgit v1.2.3