aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2013-07-28 16:34:43 -0500
committerDavid Heinemeier Hansson <david@loudthinking.com>2013-07-28 16:34:43 -0500
commitb67a80de9b55f91feb1c1056824f456710a96d0d (patch)
treee672e374bc2aea9fa3c00b8e4b3e810fcab8c8c7 /activesupport/test
parent586173204c4cff94c479518e3e9b58ef4790a764 (diff)
downloadrails-b67a80de9b55f91feb1c1056824f456710a96d0d.tar.gz
rails-b67a80de9b55f91feb1c1056824f456710a96d0d.tar.bz2
rails-b67a80de9b55f91feb1c1056824f456710a96d0d.zip
Add Time#to_s(:iso8601) for easy conversion of times to the iso8601 format for easy Javascript date parsing
Diffstat (limited to 'activesupport/test')
-rw-r--r--activesupport/test/core_ext/time_ext_test.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/time_ext_test.rb b/activesupport/test/core_ext/time_ext_test.rb
index 8741f033b5..c9e9d5cbc4 100644
--- a/activesupport/test/core_ext/time_ext_test.rb
+++ b/activesupport/test/core_ext/time_ext_test.rb
@@ -503,6 +503,7 @@ class TimeExtCalculationsTest < ActiveSupport::TestCase
assert_equal "20050221174430123456789", time.to_s(:nsec)
assert_equal "February 21, 2005 17:44", time.to_s(:long)
assert_equal "February 21st, 2005 17:44", time.to_s(:long_ordinal)
+ assert_equal "2009-02-05T14:30:05Z", Time.local(2009, 2, 5, 14, 30, 5).to_s(:iso8601)
with_env_tz "UTC" do
assert_equal "Mon, 21 Feb 2005 17:44:30 +0000", time.to_s(:rfc822)
end