diff options
author | Marek <marek.kirejczyk@gmail.com> | 2016-06-05 13:12:23 +0200 |
---|---|---|
committer | Marek <marek.kirejczyk@gmail.com> | 2016-06-05 13:12:23 +0200 |
commit | 3cf2a7184bccfb15945980d52da9666ff05c5dfd (patch) | |
tree | c50f4d25015fe96647d0ae1285e537dc89ed23fe /actionview/test/template | |
parent | 8fc355e2341f943f8533fbafa64a787c1633f086 (diff) | |
download | rails-3cf2a7184bccfb15945980d52da9666ff05c5dfd.tar.gz rails-3cf2a7184bccfb15945980d52da9666ff05c5dfd.tar.bz2 rails-3cf2a7184bccfb15945980d52da9666ff05c5dfd.zip |
Make select_year work with include_position: true option, fix #25267
Diffstat (limited to 'actionview/test/template')
-rw-r--r-- | actionview/test/template/date_helper_test.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/actionview/test/template/date_helper_test.rb b/actionview/test/template/date_helper_test.rb index e67d5d0e8c..0f89f2ca09 100644 --- a/actionview/test/template/date_helper_test.rb +++ b/actionview/test/template/date_helper_test.rb @@ -534,6 +534,13 @@ class DateHelperTest < ActionView::TestCase assert_dom_equal expected, select_year(nil, start_year: 2003, end_year: 2005, with_css_classes: { year: 'my-year' }) end + + def test_select_year_with_position + expected = %(<select id="date_year_1i" name="date[year(1i)]">\n) + expected << %(<option value="2003">2003</option>\n<option value="2004">2004</option>\n<option value="2005">2005</option>\n) + expected << "</select>\n" + assert_dom_equal expected, select_year(Date.current, include_position: true, start_year: 2003, end_year: 2005) + end def test_select_hour expected = %(<select id="date_hour" name="date[hour]">\n) |