diff options
author | Arthur Neves <arthurnn@gmail.com> | 2014-03-12 11:52:39 -0400 |
---|---|---|
committer | Arthur Neves <arthurnn@gmail.com> | 2014-03-12 11:52:39 -0400 |
commit | 7058321725ba0054390a65d8f6343613df31eea9 (patch) | |
tree | f343d187d9f4c72c3826a0fd966e423e92fef55c /activerecord | |
parent | 66d61ab63b8f0d6acb42a3343507b44b4591caae (diff) | |
download | rails-7058321725ba0054390a65d8f6343613df31eea9.tar.gz rails-7058321725ba0054390a65d8f6343613df31eea9.tar.bz2 rails-7058321725ba0054390a65d8f6343613df31eea9.zip |
Change usec to 0 on tests that compare seconds
Avoid rounding problems with `.usec` method rounding the seconds when the
field doesn't persist the `.usec` piece.
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/test/cases/persistence_test.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/test/cases/persistence_test.rb b/activerecord/test/cases/persistence_test.rb index b9f0624f76..046fe83e54 100644 --- a/activerecord/test/cases/persistence_test.rb +++ b/activerecord/test/cases/persistence_test.rb @@ -452,7 +452,7 @@ class PersistenceTest < ActiveRecord::TestCase def test_update_attribute_for_updated_at_on developer = Developer.find(1) - prev_month = Time.now.prev_month + prev_month = Time.now.prev_month.change(usec: 0) developer.update_attribute(:updated_at, prev_month) assert_equal prev_month, developer.updated_at @@ -523,7 +523,7 @@ class PersistenceTest < ActiveRecord::TestCase def test_update_column_should_not_modify_updated_at developer = Developer.find(1) - prev_month = Time.now.prev_month + prev_month = Time.now.prev_month.change(usec: 0) developer.update_column(:updated_at, prev_month) assert_equal prev_month, developer.updated_at @@ -620,7 +620,7 @@ class PersistenceTest < ActiveRecord::TestCase def test_update_columns_should_not_modify_updated_at developer = Developer.find(1) - prev_month = Time.now.prev_month + prev_month = Time.now.prev_month.change(usec: 0) developer.update_columns(updated_at: prev_month) assert_equal prev_month, developer.updated_at |