Skip to content

Commit b61ae9f

Browse files
authored
Merge pull request #72 from blocknotes/bullet/address-query-offense
Handle a failing spec related to the Bullet offense
2 parents 503b1a4 + 2e6b1d0 commit b61ae9f

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

spec/integration/attachments_spec.rb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,17 @@
1212
end
1313
let(:test_post) { Post.new(title: 'A test post', some_file: uploaded_file) }
1414

15-
it 'creates the entity with the attached file', :aggregate_failures, :skip_bullet do
15+
around do |example|
16+
# NOTE: touch_attachment_records trigger an extra includes on ActiveStorage::Attachment
17+
if ActiveStorage.respond_to?(:touch_attachment_records)
18+
touch_option = ActiveStorage.touch_attachment_records
19+
ActiveStorage.touch_attachment_records = false
20+
example.run
21+
ActiveStorage.touch_attachment_records = touch_option
22+
end
23+
end
24+
25+
it 'creates the entity with the attached file', :aggregate_failures do
1626
expect { test_post.save! }.to change(ActiveStorageDB::File, :count).by(1)
1727

1828
expect(test_post.some_file).to be_attached

0 commit comments

Comments
 (0)