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:
commit
0613533f78
1 changed files with 3 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue