From a1d57c4ab89215b70ca37c3084acb9a6fbb344c5 Mon Sep 17 00:00:00 2001 From: James B. Byrne Date: Fri, 27 Feb 2009 19:48:34 -0500 Subject: [PATCH] added form helper select method tests --- actionpack/test/template/form_helper_test.rb | 37 +++++++++++++++++++++++++- 1 files changed, 36 insertions(+), 1 deletions(-) diff --git a/actionpack/test/template/form_helper_test.rb b/actionpack/test/template/form_helper_test.rb index 654eee4..f8a59f4 100644 --- a/actionpack/test/template/form_helper_test.rb +++ b/actionpack/test/template/form_helper_test.rb @@ -98,6 +98,41 @@ class FormHelperTest < ActionView::TestCase assert_dom_equal('', label(:post, :title, nil, "for" => "my_for")) end + def test_select + expected = '' + assert_dom_equal(expected, select(:post, :title, + { 'OPTion Two' => 'OPT2', 'OPTion One' => 'OPT1' } + )) + end + + def test_select_with_blank + expected = '' + assert_dom_equal(expected, select(:post, :title, + { 'OPTion Two' => 'OPT2', 'OPTion One' => 'OPT1' }, + :include_blank => true + )) + end + + def test_select_with_blank_and_css_id + expected = '' + assert_dom_equal(expected, select(:post, :title, + { 'OPTion Two' => 'OPT2', 'OPTion One' => 'OPT1' }, + { :include_blank => true }, + :id => :my_id + )) + end + def test_text_field assert_dom_equal( '', text_field("post", "title") @@ -1173,4 +1208,4 @@ class FormHelperTest < ActionView::TestCase def protect_against_forgery? false end -end \ No newline at end of file +end -- 1.6.1.2