aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test/template/form_helper_test.rb
diff options
context:
space:
mode:
authoryuuji.yaginuma <yuuji.yaginuma@gmail.com>2016-12-27 12:47:31 +0900
committeryuuji.yaginuma <yuuji.yaginuma@gmail.com>2016-12-27 14:22:36 +0900
commitebeeceeb2aa34d33337f991607debae715ca061a (patch)
tree272a08e0f03952279a1f117ca54743738d58722e /actionview/test/template/form_helper_test.rb
parent1c2abad7e8eeb6ff480304ad7fe9d18ea7581781 (diff)
downloadrails-ebeeceeb2aa34d33337f991607debae715ca061a.tar.gz
rails-ebeeceeb2aa34d33337f991607debae715ca061a.tar.bz2
rails-ebeeceeb2aa34d33337f991607debae715ca061a.zip
do not mutate `object_name` of class in `fields_for`
Since it affects the entire form, should not mutate `object_name` of class. Fixes #26931
Diffstat (limited to 'actionview/test/template/form_helper_test.rb')
-rw-r--r--actionview/test/template/form_helper_test.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/actionview/test/template/form_helper_test.rb b/actionview/test/template/form_helper_test.rb
index 4850bc390b..3da3b95114 100644
--- a/actionview/test/template/form_helper_test.rb
+++ b/actionview/test/template/form_helper_test.rb
@@ -2262,11 +2262,13 @@ class FormHelperTest < ActionView::TestCase
concat f.fields_for("comment[]", @comment) { |c|
concat c.text_field(:name)
}
+ concat f.text_field(:body)
end
expected = whole_form("/posts/123", "edit_post[]", "edit_post[]", method: "patch") do
"<input name='post[123][title]' type='text' id='post_123_title' value='Hello World' />" +
- "<input name='post[123][comment][][name]' type='text' id='post_123_comment__name' value='new comment' />"
+ "<input name='post[123][comment][][name]' type='text' id='post_123_comment__name' value='new comment' />" +
+ "<input name='post[123][body]' type='text' id='post_123_body' value='Back to the hill and over it again!' />"
end
assert_dom_equal expected, output_buffer