diff options
author | Andrew White <andyw@pixeltrix.co.uk> | 2013-07-29 12:28:19 +0100 |
---|---|---|
committer | Andrew White <andyw@pixeltrix.co.uk> | 2013-07-29 12:31:20 +0100 |
commit | 88c0ef4d4fc86faefeec5bfff87ad882f62468d8 (patch) | |
tree | 395cf236c5bb23795dcffb613cdc7721b3da1554 /activesupport/test/core_ext/date_ext_test.rb | |
parent | cde979c38832b99d8c85b5f44f7357931ade1ee0 (diff) | |
download | rails-88c0ef4d4fc86faefeec5bfff87ad882f62468d8.tar.gz rails-88c0ef4d4fc86faefeec5bfff87ad882f62468d8.tar.bz2 rails-88c0ef4d4fc86faefeec5bfff87ad882f62468d8.zip |
Fix handling of offsets with Time#to_s(:iso8601)
Use a lambda to ensure that the generated string respects the offset of
the time value. Also add DateTime#to_s(:iso8601) and Date#to_s(:iso8601)
for completeness.
Diffstat (limited to 'activesupport/test/core_ext/date_ext_test.rb')
-rw-r--r-- | activesupport/test/core_ext/date_ext_test.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/date_ext_test.rb b/activesupport/test/core_ext/date_ext_test.rb index c32056f672..502fb21558 100644 --- a/activesupport/test/core_ext/date_ext_test.rb +++ b/activesupport/test/core_ext/date_ext_test.rb @@ -25,6 +25,7 @@ class DateExtCalculationsTest < ActiveSupport::TestCase assert_equal "February 21st, 2005", date.to_s(:long_ordinal) assert_equal "2005-02-21", date.to_s(:db) assert_equal "21 Feb 2005", date.to_s(:rfc822) + assert_equal "2005-02-21", date.to_s(:iso8601) end def test_readable_inspect |