Skip to content

Commit e0ad2e7

Browse files
Fix flaky test in AR - token for
pass time arg to @user.touch
1 parent cc359c0 commit e0ad2e7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

activerecord/test/cases/token_for_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ class User < ::User
104104
test "supports JSON-serializable embedded data" do
105105
snapshot_token = @user.generate_token_for(:snapshot)
106106
assert_equal @user, User.find_by_token_for(:snapshot, snapshot_token)
107-
@user.touch
107+
@user.touch(time: @user.updated_at.advance(seconds: 1))
108108
assert_nil User.find_by_token_for(:snapshot, snapshot_token)
109109
end
110110

0 commit comments

Comments
 (0)