From 66728087d0eb99a524498e8f24725dae6073edd6 Mon Sep 17 00:00:00 2001 From: gbuesing Date: Thu, 8 May 2008 22:48:47 -0500 Subject: Adding Date.current, which returns Time.zone.today if config.time_zone is set; otherwise returns Date.today. ActionView date_helper uses Date.current to determine locale-appropriate default --- actionpack/test/template/date_helper_test.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'actionpack/test') diff --git a/actionpack/test/template/date_helper_test.rb b/actionpack/test/template/date_helper_test.rb index 2373600bfe..905cf0ba31 100755 --- a/actionpack/test/template/date_helper_test.rb +++ b/actionpack/test/template/date_helper_test.rb @@ -950,6 +950,15 @@ class DateHelperTest < ActionView::TestCase expects(:select_minute).with(time, anything, anything).returns('') select_time end + + def test_select_date_uses_date_current_as_default + date = stub(:year => 2004, :month => 6, :day => 15) + Date.expects(:current).returns date + expects(:select_year).with(date, anything, anything).returns('') + expects(:select_month).with(date, anything, anything).returns('') + expects(:select_day).with(date, anything, anything).returns('') + select_date + end end def test_date_select -- cgit v1.2.3