From 29bc318e5f04f6d9cee6d6d120b2c52b4c4b8b47 Mon Sep 17 00:00:00 2001 From: Santiago Bartesaghi Date: Fri, 14 May 2021 13:40:09 -0300 Subject: [PATCH] Fix ActiveStorage intermittent test --- activestorage/test/models/attached/many_test.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/activestorage/test/models/attached/many_test.rb b/activestorage/test/models/attached/many_test.rb index 0a0e2a4c81..d823f2b987 100644 --- a/activestorage/test/models/attached/many_test.rb +++ b/activestorage/test/models/attached/many_test.rb @@ -655,9 +655,10 @@ class ActiveStorage::ManyAttachedTest < ActiveSupport::TestCase @user.reload racecar_blob = fixture_file_upload("racecar.jpg") + attachment_id = town_blob.attachments.find_by!(record: @user).id @user.update( highlights: [racecar_blob], - highlights_attachments_attributes: [{ id: town_blob.id, _destroy: true }] + highlights_attachments_attributes: [{ id: attachment_id, _destroy: true }] ) assert @user.reload.highlights.attached?