require 'test/unit' require File.dirname(__FILE__) + '/../../lib/action_view/helpers/form_tag_helper' class FormTagHelperTest < Test::Unit::TestCase include ActionView::Helpers::TagHelper include ActionView::Helpers::FormTagHelper MethodToTag = { %(text_field_tag("title", "Hello!")) => %(), %(text_field_tag("title", "Hello!", "class" => "admin")) => %(), %(hidden_field_tag "id", 3) => %(), %(password_field_tag) => %(), %(text_area_tag("body", "hello world", :size => "20x40")) => %(), %(text_area_tag("body", "hello world", "size" => "20x40")) => %(), %(check_box_tag("admin")) => %(), %(radio_button_tag("people", "david")) => %(), %(select_tag("people", "")) => %(), } def test_tags MethodToTag.each { |method, tag| assert_equal(tag, eval(method)) } end end