Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit 2bed685605fdcddd09376699cef2f2ffca6d0e68 1 parent 34e39d2
Nathan Bertram authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 test/action_view/cases/test_helpers.rb
7 test/action_view/cases/test_helpers.rb
View
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.