Permalink
Browse files

Test to prove out that fix prevent blow up when fields_for is not att…

…ached to form_for parent
  • Loading branch information...
1 parent 34e39d2 commit 2bed685605fdcddd09376699cef2f2ffca6d0e68 @nathanbertram committed Nov 10, 2011
Showing with 6 additions and 1 deletion.
  1. +6 −1 test/action_view/cases/test_helpers.rb
View
7 test/action_view/cases/test_helpers.rb
@@ -198,11 +198,16 @@ def test_nested_fields_for_inherit_validation_settings
concat f.fields_for(:comment, @comment) { |c|
concat c.text_field(:title)
}
+
+ concat fields_for(:another_comment) { |c|
+ concat c.text_field(:title)
+ }
+
end
validators = {'post[comment][title]' => {:presence => {:message => "can't be blank"}}}
expected = whole_form("/posts/123", "edit_post_123", "edit_post", :method => "put", :validators => validators) do
- %{<input data-validate="true" id="post_comment_title" name="post[comment][title]" size="30" type="text" />}
+ %{<input data-validate="true" id="post_comment_title" name="post[comment][title]" size="30" type="text" /><input id="another_comment_title" name="another_comment[title]" size="30" type="text" />}
end
assert_equal expected, output_buffer

0 comments on commit 2bed685

Please sign in to comment.