Skip to content

Commit

Permalink
Add failing test case for #8460
Browse files Browse the repository at this point in the history
Add a test case to ensure that fractional second updates are detected.
  • Loading branch information
pixeltrix committed Jan 22, 2013
1 parent 94f7583 commit 1cf73a6
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions activerecord/test/cases/dirty_test.rb
Expand Up @@ -566,6 +566,20 @@ def test_setting_time_attributes_with_time_zone_field_to_same_time_should_not_be
end
end

def test_datetime_attribute_can_be_updated_with_fractional_seconds
in_time_zone 'Paris' do
target = Class.new(ActiveRecord::Base)
target.table_name = 'topics'

written_on = Time.utc(2012, 12, 1, 12, 0, 0).in_time_zone('Paris')

topic = target.create(:written_on => written_on)
topic.written_on += 0.3

assert topic.written_on_changed?, 'Fractional second update not detected'
end
end

test "partial insert" do
with_partial_writes Person do
jon = nil
Expand Down

0 comments on commit 1cf73a6

Please sign in to comment.