def test_boolean_menu_on
obj = Object.new
obj.instance_eval "def foo() true end"
expected = "<select id=\"foo\" name=\"1\"><option value=\"2\" selected=\"selected\">Yes</option><option value=\"3\">No</option></select>"
output = render do |r|
r.boolean_menu_on :foo, obj
end
assert_match(/<select/, output, "Has a select element")
assert_match(/<select[^>]+id="foo"/, output, "Select has id of foo")
assert_match(/<option.*<option/, output, "Has two option elements")
assert_match(/"><[^>]+selected="selected"/, output,
"First option is selected")
assert_match(/"><[^>]+>Yes</, output, "First option is \"Yes\"")
assert_match(/n><option[^>]+>No</, output, "Second option is \"No\"")
end