From b17b980a15ee4a5f2f629d91c6fa6ca7db74daa8 Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Thu, 16 Sep 2010 23:31:57 -0700 Subject: file_field makes the enclosing form multipart --- actionpack/test/template/form_helper_test.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'actionpack/test') diff --git a/actionpack/test/template/form_helper_test.rb b/actionpack/test/template/form_helper_test.rb index 97a08d45ba..348aa208c7 100644 --- a/actionpack/test/template/form_helper_test.rb +++ b/actionpack/test/template/form_helper_test.rb @@ -665,6 +665,24 @@ class FormHelperTest < ActionView::TestCase assert_dom_equal expected, output_buffer end + def test_form_for_with_file_field_generate_multipart + Post.send :attr_accessor, :file + + assert_deprecated do + form_for(:post, @post, :html => { :id => 'create-post' }) do |f| + concat f.file_field(:file) + end + end + + expected = + "
" + + snowman + + "" + + "
" + + assert_dom_equal expected, output_buffer + end + def test_form_for_with_format form_for(@post, :format => :json, :html => { :id => "edit_post_123", :class => "edit_post" }) do |f| concat f.label(:title) -- cgit v1.2.3