diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-01-01 01:36:18 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-01-01 01:36:18 +0000 |
commit | a0b1ac2ef8a5a4d8ed8544aa56d2bc87968c6069 (patch) | |
tree | 790f6f8a0b03c21c909f89f210bfbbfda4c9e6dd | |
parent | e03cd53a7ae90e6a6ccacdb4fd4f51d14d96fad0 (diff) | |
download | rails-a0b1ac2ef8a5a4d8ed8544aa56d2bc87968c6069.tar.gz rails-a0b1ac2ef8a5a4d8ed8544aa56d2bc87968c6069.tar.bz2 rails-a0b1ac2ef8a5a4d8ed8544aa56d2bc87968c6069.zip |
Fix date helper test when run on 31st day of the month! Closes #6907. [mutru]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5826 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rwxr-xr-x | actionpack/test/template/date_helper_test.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/actionpack/test/template/date_helper_test.rb b/actionpack/test/template/date_helper_test.rb index 7bb6b17f5d..bd3ad09db8 100755 --- a/actionpack/test/template/date_helper_test.rb +++ b/actionpack/test/template/date_helper_test.rb @@ -853,7 +853,7 @@ class DateHelperTest < Test::Unit::TestCase expected << "</select>\n" expected << %{<select id="post_written_on_2i" name="post[written_on(2i)]">\n} - 1.upto(12) { |i| expected << %(<option value="#{i}"#{' selected="selected"' if i == 6}>#{Time.now.change(:month => i).strftime("%B")}</option>\n) } + 1.upto(12) { |i| expected << %(<option value="#{i}"#{' selected="selected"' if i == 6}>#{Date::MONTHNAMES[i]}</option>\n) } expected << "</select>\n" expected << %{<select id="post_written_on_1i" name="post[written_on(1i)]">\n} @@ -873,7 +873,7 @@ class DateHelperTest < Test::Unit::TestCase expected << "</select>\n" expected << %{<select id="post_written_on_2i" name="post[written_on(2i)]">\n} - 1.upto(12) { |i| expected << %(<option value="#{i}"#{' selected="selected"' if i == Time.now.month}>#{Time.now.change(:month => i).strftime("%B")}</option>\n) } + 1.upto(12) { |i| expected << %(<option value="#{i}"#{' selected="selected"' if i == Time.now.month}>#{Date::MONTHNAMES[i]}</option>\n) } expected << "</select>\n" expected << %{<select id="post_written_on_3i" name="post[written_on(3i)]">\n} @@ -895,7 +895,7 @@ class DateHelperTest < Test::Unit::TestCase expected << %{<select id="post_written_on_2i" name="post[written_on(2i)]">\n} expected << "<option value=\"\"></option>\n" - 1.upto(12) { |i| expected << %(<option value="#{i}">#{Time.now.change(:month => i).strftime("%B")}</option>\n) } + 1.upto(12) { |i| expected << %(<option value="#{i}">#{Date::MONTHNAMES[i]}</option>\n) } expected << "</select>\n" expected << %{<select id="post_written_on_3i" name="post[written_on(3i)]">\n} @@ -1178,7 +1178,7 @@ class DateHelperTest < Test::Unit::TestCase 1999.upto(2009) { |i| expected << %(<option value="#{i}"#{' selected="selected"' if i == 2004}>#{i}</option>\n) } expected << "</select>\n" expected << %{<select id="post_updated_at_2i" name="post[updated_at(2i)]">\n} - 1.upto(12) { |i| expected << %(<option value="#{i}"#{' selected="selected"' if i == 6}>#{Time.now.change(:month => i).strftime("%B")}</option>\n) } + 1.upto(12) { |i| expected << %(<option value="#{i}"#{' selected="selected"' if i == 6}>#{Date::MONTHNAMES[i]}</option>\n) } expected << "</select>\n" expected << %{<select id="post_updated_at_3i" name="post[updated_at(3i)]">\n} 1.upto(31) { |i| expected << %(<option value="#{i}"#{' selected="selected"' if i == 15}>#{i}</option>\n) } @@ -1207,7 +1207,7 @@ class DateHelperTest < Test::Unit::TestCase expected = %{<input type="hidden" id="post_updated_at_1i" name="post[updated_at(1i)]" value="2004" />\n} expected << %{<select id="post_updated_at_2i" name="post[updated_at(2i)]">\n} - 1.upto(12) { |i| expected << %(<option value="#{i}"#{' selected="selected"' if i == 6}>#{Time.now.change(:month => i).strftime("%B")}</option>\n) } + 1.upto(12) { |i| expected << %(<option value="#{i}"#{' selected="selected"' if i == 6}>#{Date::MONTHNAMES[i]}</option>\n) } expected << "</select>\n" expected << %{<select id="post_updated_at_3i" name="post[updated_at(3i)]">\n} 1.upto(31) { |i| expected << %(<option value="#{i}"#{' selected="selected"' if i == 15}>#{i}</option>\n) } @@ -1276,7 +1276,7 @@ class DateHelperTest < Test::Unit::TestCase 1.upto(31) { |i| expected << %(<option value="#{i}"#{' selected="selected"' if i == 15}>#{i}</option>\n) } expected << "</select>\n" expected << %{<select id="post_updated_at_2i" name="post[updated_at(2i)]">\n} - 1.upto(12) { |i| expected << %(<option value="#{i}"#{' selected="selected"' if i == 6}>#{Time.now.change(:month => i).strftime("%B")}</option>\n) } + 1.upto(12) { |i| expected << %(<option value="#{i}"#{' selected="selected"' if i == 6}>#{Date::MONTHNAMES[i]}</option>\n) } expected << "</select>\n" expected << %{<select id="post_updated_at_1i" name="post[updated_at(1i)]">\n} 1999.upto(2009) { |i| expected << %(<option value="#{i}"#{' selected="selected"' if i == 2004}>#{i}</option>\n) } @@ -1304,7 +1304,7 @@ class DateHelperTest < Test::Unit::TestCase 1.upto(31) { |i| expected << %(<option value="#{i}"#{' selected="selected"' if i == 15}>#{i}</option>\n) } expected << "</select>\n" expected << %{<select id="post_updated_at_2i" name="post[updated_at(2i)]">\n} - 1.upto(12) { |i| expected << %(<option value="#{i}"#{' selected="selected"' if i == 6}>#{Time.now.change(:month => i).strftime("%B")}</option>\n) } + 1.upto(12) { |i| expected << %(<option value="#{i}"#{' selected="selected"' if i == 6}>#{Date::MONTHNAMES[i]}</option>\n) } expected << "</select>\n" expected << " — " |