diff --git a/spec/integration/attachments_spec.rb b/spec/integration/attachments_spec.rb index 8536d04..3084fe6 100644 --- a/spec/integration/attachments_spec.rb +++ b/spec/integration/attachments_spec.rb @@ -12,7 +12,17 @@ end let(:test_post) { Post.new(title: 'A test post', some_file: uploaded_file) } - it 'creates the entity with the attached file', :aggregate_failures, :skip_bullet do + around do |example| + # NOTE: touch_attachment_records trigger an extra includes on ActiveStorage::Attachment + if ActiveStorage.respond_to?(:touch_attachment_records) + touch_option = ActiveStorage.touch_attachment_records + ActiveStorage.touch_attachment_records = false + example.run + ActiveStorage.touch_attachment_records = touch_option + end + end + + it 'creates the entity with the attached file', :aggregate_failures do expect { test_post.save! }.to change(ActiveStorageDB::File, :count).by(1) expect(test_post.some_file).to be_attached