From f7669cd8344a83485d01f94e7b5896616cd57f51 Mon Sep 17 00:00:00 2001 From: Vasiliy Ermolovich Date: Sat, 24 Dec 2011 00:44:23 +0300 Subject: add ability to set a prompt string in include_blank option for date helpers, closes #4143 --- actionpack/test/template/date_helper_test.rb | 20 ++++++++++++++++++++ 1 file changed, 20 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..21c9083386 100644 --- a/actionpack/test/template/date_helper_test.rb +++ b/actionpack/test/template/date_helper_test.rb @@ -1581,6 +1581,26 @@ class DateHelperTest < ActionView::TestCase assert_dom_equal expected, date_select("post", "written_on", :include_blank => true) end + def test_date_select_with_stringified_blank + @post = Post.new + + start_year = Time.now.year-5 + end_year = Time.now.year+5 + + expected = '' + "\n" + expected << %{\n" + + expected << %{\n" + + assert_dom_equal expected, date_select("post", "written_on", :order=>[:year, :month], :include_blank=> 'blank') + end + def test_date_select_with_nil_and_blank_and_order @post = Post.new -- cgit v1.2.3