From 8e8bf37aa9ff4a32838ac477f97b458e9b99da7e Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 17 Apr 2005 09:44:28 +0000 Subject: Fixed DateHelper to return values on the option tags such that they'll work properly in IE with form_remote_tag #1024 [rscottmace@gmail.com] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1184 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/test/template/date_helper_test.rb | 97 ++++++++++++++-------------- 1 file changed, 48 insertions(+), 49 deletions(-) (limited to 'actionpack/test/template/date_helper_test.rb') diff --git a/actionpack/test/template/date_helper_test.rb b/actionpack/test/template/date_helper_test.rb index ab5cfc1c7a..d33ce160d8 100755 --- a/actionpack/test/template/date_helper_test.rb +++ b/actionpack/test/template/date_helper_test.rb @@ -34,7 +34,7 @@ class DateHelperTest < Test::Unit::TestCase def test_select_day expected = %(\n" assert_equal expected, select_day(Time.mktime(2003, 8, 16)) @@ -44,7 +44,7 @@ class DateHelperTest < Test::Unit::TestCase def test_select_day_with_blank expected = %(\n" assert_equal expected, select_day(Time.mktime(2003, 8, 16), :include_blank => true) @@ -54,7 +54,7 @@ class DateHelperTest < Test::Unit::TestCase def test_select_day_nil_with_blank expected = %(\n" assert_equal expected, select_day(nil, :include_blank => true) @@ -71,7 +71,7 @@ class DateHelperTest < Test::Unit::TestCase def test_select_month_with_blank expected = %(\n" assert_equal expected, select_month(Time.mktime(2003, 8, 16), :include_blank => true) @@ -80,7 +80,7 @@ class DateHelperTest < Test::Unit::TestCase def test_select_month_nil_with_blank expected = %(\n" assert_equal expected, select_month(nil, :include_blank => true) @@ -106,7 +106,7 @@ class DateHelperTest < Test::Unit::TestCase def test_select_year expected = %(\n" assert_equal expected, select_year(Time.mktime(2003, 8, 16), :start_year => 2003, :end_year => 2005) @@ -115,7 +115,7 @@ class DateHelperTest < Test::Unit::TestCase def test_select_year_with_type_discarding expected = %(\n" assert_equal expected, select_year( @@ -126,7 +126,7 @@ class DateHelperTest < Test::Unit::TestCase def test_select_hour expected = %(\n" assert_equal expected, select_hour(Time.mktime(2003, 8, 16, 8, 4, 18)) @@ -134,7 +134,7 @@ class DateHelperTest < Test::Unit::TestCase def test_select_hour_with_blank expected = %(\n" assert_equal expected, select_hour(Time.mktime(2003, 8, 16, 8, 4, 18), :include_blank => true) @@ -142,7 +142,7 @@ class DateHelperTest < Test::Unit::TestCase def test_select_hour_nil_with_blank expected = %(\n" assert_equal expected, select_hour(nil, :include_blank => true) @@ -150,7 +150,7 @@ class DateHelperTest < Test::Unit::TestCase def test_select_minute expected = %(\n" assert_equal expected, select_minute(Time.mktime(2003, 8, 16, 8, 4, 18)) @@ -158,7 +158,7 @@ class DateHelperTest < Test::Unit::TestCase def test_select_minute_with_blank expected = %(\n" assert_equal expected, select_minute(Time.mktime(2003, 8, 16, 8, 4, 18), :include_blank => true) @@ -166,7 +166,7 @@ class DateHelperTest < Test::Unit::TestCase def test_select_minute_with_blank_and_step expected = %(\n" assert_equal expected, select_minute(Time.mktime(2003, 8, 16, 8, 4, 18), { :include_blank => true , :minute_step => 15 }) @@ -174,7 +174,7 @@ class DateHelperTest < Test::Unit::TestCase def test_select_minute_nil_with_blank expected = %(\n" assert_equal expected, select_minute(nil, :include_blank => true) @@ -182,7 +182,7 @@ class DateHelperTest < Test::Unit::TestCase def test_select_minute_nil_with_blank_and_step expected = %(\n" assert_equal expected, select_minute(nil, { :include_blank => true , :minute_step => 15 }) @@ -190,7 +190,7 @@ class DateHelperTest < Test::Unit::TestCase def test_select_second expected = %(\n" assert_equal expected, select_second(Time.mktime(2003, 8, 16, 8, 4, 18)) @@ -198,7 +198,7 @@ class DateHelperTest < Test::Unit::TestCase def test_select_second_with_blank expected = %(\n" assert_equal expected, select_second(Time.mktime(2003, 8, 16, 8, 4, 18), :include_blank => true) @@ -206,7 +206,7 @@ class DateHelperTest < Test::Unit::TestCase def test_select_second_nil_with_blank expected = %(\n" assert_equal expected, select_second(nil, :include_blank => true) @@ -214,7 +214,7 @@ class DateHelperTest < Test::Unit::TestCase def test_select_date expected = %(\n" expected << %(\n) expected << -%(\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n) +%(\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" assert_equal expected, select_date( @@ -235,9 +235,9 @@ class DateHelperTest < Test::Unit::TestCase expected = %(\n" @@ -248,7 +248,7 @@ class DateHelperTest < Test::Unit::TestCase expected << %(\n" assert_equal expected, select_date( @@ -260,9 +260,9 @@ class DateHelperTest < Test::Unit::TestCase expected = %(\n" @@ -273,7 +273,7 @@ class DateHelperTest < Test::Unit::TestCase expected << %(\n" assert_equal expected, select_date( @@ -285,9 +285,9 @@ class DateHelperTest < Test::Unit::TestCase expected = %(\n" @@ -298,7 +298,7 @@ class DateHelperTest < Test::Unit::TestCase expected << %(\n" assert_equal expected, select_date( @@ -308,15 +308,15 @@ class DateHelperTest < Test::Unit::TestCase def test_select_time_with_seconds expected = %(\n" expected << %(\n" expected << %(\n" assert_equal expected, select_time(Time.mktime(2003, 8, 16, 8, 4, 18), :include_seconds => true) @@ -324,11 +324,11 @@ class DateHelperTest < Test::Unit::TestCase def test_select_time_without_seconds expected = %(\n" expected << %(\n" assert_equal expected, select_time(Time.mktime(2003, 8, 16, 8, 4, 18)) @@ -337,7 +337,7 @@ class DateHelperTest < Test::Unit::TestCase def test_date_select_with_zero_value expected = %(\n" expected << %(\n) expected << -%(\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n) +%(\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" assert_equal expected, select_date(0, :start_year => 2003, :end_year => 2005, :prefix => "date[first]") @@ -354,7 +354,7 @@ class DateHelperTest < Test::Unit::TestCase def test_date_select_with_zero_value_and_no_start_year expected = %(\n" expected << %(\n) expected << -%(\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n) +%(\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" assert_equal expected, select_date(0, :end_year => Date.today.year+1, :prefix => "date[first]") @@ -371,7 +371,7 @@ class DateHelperTest < Test::Unit::TestCase def test_date_select_with_zero_value_and_no_end_year expected = %(\n" expected << %(\n) expected << -%(\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n) +%(\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" assert_equal expected, select_date(0, :start_year => 2003, :prefix => "date[first]") @@ -388,7 +388,7 @@ class DateHelperTest < Test::Unit::TestCase def test_date_select_with_zero_value_and_no_start_and_end_year expected = %(\n" expected << %(\n) expected << -%(\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n) +%(\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" assert_equal expected, select_date(0, :prefix => "date[first]") @@ -405,7 +405,7 @@ class DateHelperTest < Test::Unit::TestCase def test_date_select_with_nil_value_and_no_start_and_end_year expected = %(\n" expected << %(\n) expected << -%(\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n) +%(\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" assert_equal expected, select_date(nil, :prefix => "date[first]") @@ -422,7 +422,7 @@ class DateHelperTest < Test::Unit::TestCase def test_datetime_select_with_nil_value_and_no_start_and_end_year expected = %(\n" expected << %(\n) expected << -%(\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n) +%(\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" expected << %(\n" expected << %(\n" assert_equal expected, select_datetime(nil, :prefix => "date[first]") end - end -- cgit v1.2.3