diff options
author | Andrew White <andrew.white@unboxed.co> | 2017-03-03 20:14:22 +0000 |
---|---|---|
committer | Andrew White <andrew.white@unboxed.co> | 2017-03-03 21:53:13 +0000 |
commit | f0aeecda1450ba17701ccba68e5a796ce4ac4c3b (patch) | |
tree | 5577db6b1f3424711bf3b35493ba55cf95ae86b7 /activesupport/test/core_ext/time_ext_test.rb | |
parent | 08e05d4a49c1ba1327e3e6821eba1f0c93361ab2 (diff) | |
download | rails-f0aeecda1450ba17701ccba68e5a796ce4ac4c3b.tar.gz rails-f0aeecda1450ba17701ccba68e5a796ce4ac4c3b.tar.bz2 rails-f0aeecda1450ba17701ccba68e5a796ce4ac4c3b.zip |
Add `rfc3339` aliases to `xmlschema`
For naming consistency when using the RFC 3339 profile
of ISO 8601 in applications.
Diffstat (limited to 'activesupport/test/core_ext/time_ext_test.rb')
-rw-r--r-- | activesupport/test/core_ext/time_ext_test.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/time_ext_test.rb b/activesupport/test/core_ext/time_ext_test.rb index 8b60494143..bd644c8457 100644 --- a/activesupport/test/core_ext/time_ext_test.rb +++ b/activesupport/test/core_ext/time_ext_test.rb @@ -569,6 +569,11 @@ class TimeExtCalculationsTest < ActiveSupport::TestCase Time::DATE_FORMATS.delete(:custom) end + def test_rfc3339_with_fractional_seconds + time = Time.new(1999, 12, 31, 19, 0, Rational(1, 8), -18000) + assert_equal "1999-12-31T19:00:00.125-05:00", time.rfc3339(3) + end + def test_to_date assert_equal Date.new(2005, 2, 21), Time.local(2005, 2, 21, 17, 44, 30).to_date end |