1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #31919 from bogdanvlviv/fix-test_counter_cache_with_touch_and_lock_version

Fix `test_counter_cache_with_touch_and_lock_version` failure
This commit is contained in:
Ryuta Kamizono 2018-02-09 09:43:34 +09:00 committed by GitHub
commit 0613533f78
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -415,7 +415,9 @@ class OptimisticLockingTest < ActiveRecord::TestCase
assert_equal 1, car.lock_version
previously_car_updated_at = car.updated_at
car.wheels.first.update(size: 42)
travel(1.day) do
car.wheels.first.update(size: 42)
end
assert_equal 1, car.reload.wheels_count
assert_not_equal previously_car_updated_at, car.updated_at