diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-12-21 22:18:07 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-12-21 22:18:07 +0000 |
commit | a81333f115c877fc59601f4e0766df4bdce4a8d8 (patch) | |
tree | c2d1cfc1529a6c74e41680a427b0926fc9a78d52 /actionpack/test/template | |
parent | 470fc0209699d70e9e2349d35f3210757a7a7d17 (diff) | |
download | rails-a81333f115c877fc59601f4e0766df4bdce4a8d8.tar.gz rails-a81333f115c877fc59601f4e0766df4bdce4a8d8.tar.bz2 rails-a81333f115c877fc59601f4e0766df4bdce4a8d8.zip |
Add :default option to time_zone_select. Closes #10590.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8473 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/template')
-rw-r--r-- | actionpack/test/template/form_options_helper_test.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/actionpack/test/template/form_options_helper_test.rb b/actionpack/test/template/form_options_helper_test.rb index bd062057fa..966a00ff0b 100644 --- a/actionpack/test/template/form_options_helper_test.rb +++ b/actionpack/test/template/form_options_helper_test.rb @@ -1294,4 +1294,32 @@ COUNTRIES "</select>", html end + + def test_time_zone_select_with_default_time_zone_and_nil_value + @firm = Firm.new() + @firm.time_zone = nil + html = time_zone_select( "firm", "time_zone", nil, :default => 'B' ) + assert_dom_equal "<select id=\"firm_time_zone\" name=\"firm[time_zone]\">" + + "<option value=\"A\">A</option>\n" + + "<option value=\"B\" selected=\"selected\">B</option>\n" + + "<option value=\"C\">C</option>\n" + + "<option value=\"D\">D</option>\n" + + "<option value=\"E\">E</option>" + + "</select>", + html + end + + def test_time_zone_select_with_default_time_zone_and_value + @firm = Firm.new('D') + html = time_zone_select( "firm", "time_zone", nil, :default => 'B' ) + assert_dom_equal "<select id=\"firm_time_zone\" name=\"firm[time_zone]\">" + + "<option value=\"A\">A</option>\n" + + "<option value=\"B\">B</option>\n" + + "<option value=\"C\">C</option>\n" + + "<option value=\"D\" selected=\"selected\">D</option>\n" + + "<option value=\"E\">E</option>" + + "</select>", + html + end + end |