From 4444294cd95afff3e58a3d6b2b5dce213f93fcc5 Mon Sep 17 00:00:00 2001 From: bogdanvlviv Date: Wed, 7 Feb 2018 11:32:02 +0200 Subject: Fix `test_counter_cache_with_touch_and_lock_version` failure https://travis-ci.org/rails/rails/jobs/338338927#L1043 Related to daf15f58b943d85d8fb726590ae94f77ca0a5d5f --- activerecord/test/cases/locking_test.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'activerecord/test') diff --git a/activerecord/test/cases/locking_test.rb b/activerecord/test/cases/locking_test.rb index bb76137ef5..02be0aa9e3 100644 --- a/activerecord/test/cases/locking_test.rb +++ b/activerecord/test/cases/locking_test.rb @@ -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 -- cgit v1.2.3