We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 503b1a4 + 2e6b1d0 commit b61ae9fCopy full SHA for b61ae9f
1 file changed
spec/integration/attachments_spec.rb
@@ -12,7 +12,17 @@
12
end
13
let(:test_post) { Post.new(title: 'A test post', some_file: uploaded_file) }
14
15
- it 'creates the entity with the attached file', :aggregate_failures, :skip_bullet do
+ 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
24
+
25
+ it 'creates the entity with the attached file', :aggregate_failures do
26
expect { test_post.save! }.to change(ActiveStorageDB::File, :count).by(1)
27
28
expect(test_post.some_file).to be_attached
0 commit comments