From 920660b19c5419c6df1c234a84e7fec71b169544 Mon Sep 17 00:00:00 2001 From: Aditya Sanghi Date: Fri, 15 Oct 2010 22:43:01 +0530 Subject: patching to ensure separator is printed with order [#5816 state:resolved] Signed-off-by: Santiago Pastorino --- actionpack/test/template/date_helper_test.rb | 41 ++++++++++++++++++++++++++++ 1 file changed, 41 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 0cf7885772..55c384e68f 100644 --- a/actionpack/test/template/date_helper_test.rb +++ b/actionpack/test/template/date_helper_test.rb @@ -1584,6 +1584,47 @@ class DateHelperTest < ActionView::TestCase assert_dom_equal expected, date_select("post", "written_on", { :date_separator => " / " }) end + def test_date_select_with_separator_and_order + @post = Post.new + @post.written_on = Date.new(2004, 6, 15) + + expected = %{\n" + + expected << " / " + + expected << %{\n" + + expected << " / " + + expected << %{\n" + + assert_dom_equal expected, date_select("post", "written_on", { :order => [:day, :month, :year], :date_separator => " / " }) + end + + def test_date_select_with_separator_and_order_and_year_discarded + @post = Post.new + @post.written_on = Date.new(2004, 6, 15) + + expected = %{\n" + + expected << " / " + + expected << %{\n" + expected << %{\n} + + assert_dom_equal expected, date_select("post", "written_on", { :order => [:day, :month, :year], :discard_year => true, :date_separator => " / " }) + end + def test_date_select_with_default_prompt @post = Post.new @post.written_on = Date.new(2004, 6, 15) -- cgit v1.2.3