Created
April 8, 2014 03:15
-
-
Save johnnaegle/10086659 to your computer and use it in GitHub Desktop.
Demonstrates that ActiveSupport::TimeWithZone has milliseconds in Rails 4.0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem 'activesupport', '4.0.4' | |
require 'active_support/time' | |
require 'active_support/time_with_zone' | |
require 'active_support/core_ext/date_time/zones.rb' | |
require 'minitest/autorun' | |
class UserTest < MiniTest::Unit::TestCase | |
def test_no_milliseconds | |
time = ActiveSupport::TimeWithZone.new(Time.now, Time.find_zone!('UTC')) | |
assert_equal 1, time.as_json.split('.').length | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment