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.
1 parent 201d6f5 commit 2e6b1d0Copy full SHA for 2e6b1d0
spec/integration/attachments_spec.rb
@@ -12,6 +12,16 @@
12
end
13
let(:test_post) { Post.new(title: 'A test post', some_file: uploaded_file) }
14
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
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
0 commit comments