From 71b77a3d6aa527b3486f89556ca3752e06985146 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Wed, 13 Jun 2007 01:20:55 +0000 Subject: Improve helper test coverage. Closes #7215, #7233, #7234, #7235, #7236, #7237, #7238. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7011 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- .../test/template/form_options_helper_test.rb | 28 ++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (limited to 'actionpack/test/template/form_options_helper_test.rb') diff --git a/actionpack/test/template/form_options_helper_test.rb b/actionpack/test/template/form_options_helper_test.rb index 3c0a96b0de..aa7869641d 100644 --- a/actionpack/test/template/form_options_helper_test.rb +++ b/actionpack/test/template/form_options_helper_test.rb @@ -296,7 +296,7 @@ class FormOptionsHelperTest < Test::Unit::TestCase select("post", "category", %w( abe hest), :prompt => true, :include_blank => true) ) end - + def test_select_with_selected_value @post = Post.new @post.category = "" @@ -416,6 +416,30 @@ class FormOptionsHelperTest < Test::Unit::TestCase ) end + def test_country_select_with_priority_countries + @post = Post.new + @post.origin = "Denmark" + assert_dom_equal( + "", + country_select("post", "origin", ["New Zealand", "Nicaragua"]) + ) + end + + def test_country_select_with_selected_priority_country + @post = Post.new + @post.origin = "New Zealand" + assert_dom_equal( + "", + country_select("post", "origin", ["New Zealand", "Nicaragua"]) + ) + end + def test_time_zone_select @firm = Firm.new("D") html = time_zone_select( "firm", "time_zone" ) @@ -449,7 +473,7 @@ class FormOptionsHelperTest < Test::Unit::TestCase _erbout ) end - + def test_time_zone_select_with_blank @firm = Firm.new("D") html = time_zone_select("firm", "time_zone", nil, :include_blank => true) -- cgit v1.2.3