aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template/active_record_helper_test.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-09-11 08:39:23 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-09-11 08:39:23 +0000
commita15068726f4f63fbdf830da2be8560f1b99f5d9d (patch)
tree4a07c7ea385ee223579ed49c5c1c5dda4cccef70 /actionpack/test/template/active_record_helper_test.rb
parent8ae68efcf84d9c9927c4db7dfeb0f41693b9e555 (diff)
downloadrails-a15068726f4f63fbdf830da2be8560f1b99f5d9d.tar.gz
rails-a15068726f4f63fbdf830da2be8560f1b99f5d9d.tar.bz2
rails-a15068726f4f63fbdf830da2be8560f1b99f5d9d.zip
Added :multipart option to ActiveRecordHelper#form to make it possible to add file input fields #2034 [jstirk@oobleyboo.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2193 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/template/active_record_helper_test.rb')
-rw-r--r--actionpack/test/template/active_record_helper_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/actionpack/test/template/active_record_helper_test.rb b/actionpack/test/template/active_record_helper_test.rb
index cfbe3b62b7..6d416fedfb 100644
--- a/actionpack/test/template/active_record_helper_test.rb
+++ b/actionpack/test/template/active_record_helper_test.rb
@@ -119,4 +119,11 @@ class ActiveRecordHelperTest < Test::Unit::TestCase
assert_equal %(<div class="errorExplanation" id="errorExplanation"><h2>1 error prohibited this post from being saved</h2><p>There were problems with the following fields:</p><ul><li>Author name can't be empty</li></ul></div>), error_messages_for("post")
assert_equal %(<div class="errorDeathByClass" id="errorDeathById"><h1>1 error prohibited this post from being saved</h1><p>There were problems with the following fields:</p><ul><li>Author name can't be empty</li></ul></div>), error_messages_for("post", :class => "errorDeathByClass", :id => "errorDeathById", :header_tag => "h1")
end
+
+ def test_form_with_string_multipart
+ assert_equal(
+ %(<form action="create" enctype="multipart/form-data" method="post"><p><label for="post_title">Title</label><br /><input id="post_title" name="post[title]" size="30" type="text" value="Hello World" /></p>\n<p><label for="post_body">Body</label><br /><div class="fieldWithErrors"><textarea cols="40" id="post_body" name="post[body]" rows="20">Back to the hill and over it again!</textarea></div></p><input name="commit" type="submit" value="Create" /></form>),
+ form("post", :multipart => true)
+ )
+ end
end