From 0cf79f07b0be7bb9912dfe2a9f2f4c45d98ac41e Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Thu, 31 May 2007 16:38:36 +0000 Subject: Fixed that DateHelper#date_select should set the day to the 1st when its a hidden option and the month is visible (or invalid dates can be produced) [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6911 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/test/template/date_helper_test.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'actionpack/test') diff --git a/actionpack/test/template/date_helper_test.rb b/actionpack/test/template/date_helper_test.rb index f78819cfce..8f92840c78 100755 --- a/actionpack/test/template/date_helper_test.rb +++ b/actionpack/test/template/date_helper_test.rb @@ -784,6 +784,23 @@ class DateHelperTest < Test::Unit::TestCase assert_equal expected, date_select("post", "written_on") end + def test_date_select_without_day + @post = Post.new + @post.written_on = Date.new(2004, 6, 15) + + expected = "\n" + + expected << %{\n" + + expected << %{\n" + + assert_equal expected, date_select("post", "written_on", :order => [ :month, :year ]) + end + def test_date_select_within_fields_for @post = Post.new @post.written_on = Date.new(2004, 6, 15) -- cgit v1.2.3