diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-04-05 12:53:26 -0700 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-04-05 12:53:26 -0700 |
commit | dbe25910faabedfeae3e1f284cbfb6af746201c6 (patch) | |
tree | 21873c3e66e6b40a4855e510b47c0df1f1a965d3 /actionpack/test/template/form_helper_test.rb | |
parent | fe588537654adc583d54157b1a5db48786452adf (diff) | |
parent | 44a9aedd7b8d65517b15bbbb7729f3f16991e23f (diff) | |
download | rails-dbe25910faabedfeae3e1f284cbfb6af746201c6.tar.gz rails-dbe25910faabedfeae3e1f284cbfb6af746201c6.tar.bz2 rails-dbe25910faabedfeae3e1f284cbfb6af746201c6.zip |
Merge pull request #10105 from rmm5t/fix-explicit-name-on-multiple-fields
Fix explicit names on multiple file fields
Diffstat (limited to 'actionpack/test/template/form_helper_test.rb')
-rw-r--r-- | actionpack/test/template/form_helper_test.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/actionpack/test/template/form_helper_test.rb b/actionpack/test/template/form_helper_test.rb index 7b35424ec7..22af39add4 100644 --- a/actionpack/test/template/form_helper_test.rb +++ b/actionpack/test/template/form_helper_test.rb @@ -301,6 +301,16 @@ class FormHelperTest < ActionView::TestCase assert_dom_equal expected, file_field("user", "avatar") end + def test_file_field_with_multiple_behavior + expected = '<input id="import_file" multiple="multiple" name="import[file][]" type="file" />' + assert_dom_equal expected, file_field("import", "file", :multiple => true) + end + + def test_file_field_with_multiple_behavior_and_explicit_name + expected = '<input id="import_file" multiple="multiple" name="custom" type="file" />' + assert_dom_equal expected, file_field("import", "file", :multiple => true, :name => "custom") + end + def test_hidden_field assert_dom_equal '<input id="post_title" name="post[title]" type="hidden" value="Hello World" />', hidden_field("post", "title") |