From d4cfc4cec00b21f7fc47c094107168dbc0d8ed2c Mon Sep 17 00:00:00 2001 From: Indrek Juhkam Date: Fri, 20 Jan 2012 14:13:21 +0200 Subject: Add failing test for date_select date_select does not work when day is discarded, include blank option is enabled and struct date itself is nil. --- actionpack/test/template/date_helper_test.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (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 fadfb59572..43fece397b 100644 --- a/actionpack/test/template/date_helper_test.rb +++ b/actionpack/test/template/date_helper_test.rb @@ -1396,6 +1396,22 @@ class DateHelperTest < ActionView::TestCase assert_dom_equal expected, date_select("post", "written_on", :order => [ :month, :year ]) end + def test_date_select_without_day_and_include_blank_option_when_written_on_is_nil + @post = Post.new + + expected = "\n" + + expected << %{\n" + + expected << %{\n" + + assert_dom_equal expected, date_select("post", "written_on", :start_year => 1999, :end_year => 2009, :order => [ :month, :year ], :discard_day => true, :include_blank => true) + end + def test_date_select_without_day_with_separator @post = Post.new @post.written_on = Date.new(2004, 6, 15) -- cgit v1.2.3