From 967339e4d324daa659e5f625d48a56dc17d5287e Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sat, 19 Feb 2005 12:49:14 +0000 Subject: Added FormTagHelper that provides a number of methods for creating form tags that doesn't rely on conventions with an object assigned to the template like FormHelper does. With the FormTagHelper, you provide the names and values yourself. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@687 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/test/template/form_tag_helper_test.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 actionpack/test/template/form_tag_helper_test.rb (limited to 'actionpack/test') diff --git a/actionpack/test/template/form_tag_helper_test.rb b/actionpack/test/template/form_tag_helper_test.rb new file mode 100644 index 0000000000..5806c879fd --- /dev/null +++ b/actionpack/test/template/form_tag_helper_test.rb @@ -0,0 +1,19 @@ +require 'test/unit' +require File.dirname(__FILE__) + '/../../lib/action_view/helpers/form_tag_helper' + +class TagHelperTest < Test::Unit::TestCase + include ActionView::Helpers::TagHelper + include ActionView::Helpers::FormTagHelper + + MethodToTag = { + %(text_field_tag("title", "Hello!")) => %(), + %(text_field_tag("title", "Hello!", "class" => "admin")) => %(), + %(password_field_tag) => %(), + %(text_area_tag("body", "hello world", :size => "20x40")) => %(), + %(check_box_tag("admin")) => %(), + } + + def test_tags + MethodToTag.each { |method, tag| assert_equal(eval(method), tag) } + end +end \ No newline at end of file -- cgit v1.2.3