diff options
author | Godfrey Chan <godfreykfc@gmail.com> | 2016-06-25 10:57:57 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-06-25 10:57:57 +0800 |
commit | a4acb4da6ed3df6b583c58dc28ac729a2f5d75c1 (patch) | |
tree | 9641e7e479bd38f471efdd2f80c0bfdc0a5be83b /actionview/test | |
parent | 40bf7a52d51498879d9b442663b7a23f37fb1204 (diff) | |
parent | 3cf2a7184bccfb15945980d52da9666ff05c5dfd (diff) | |
download | rails-a4acb4da6ed3df6b583c58dc28ac729a2f5d75c1.tar.gz rails-a4acb4da6ed3df6b583c58dc28ac729a2f5d75c1.tar.bz2 rails-a4acb4da6ed3df6b583c58dc28ac729a2f5d75c1.zip |
Merge pull request #25287 from marekkirejczyk/fix_25267
Make select_year work with include_position: true option, fix #25267
Diffstat (limited to 'actionview/test')
-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) |