1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Prepend module in ActiveStorage overview

[ci skip]
This commit is contained in:
Sam Bostock 2018-12-10 18:20:23 -05:00
parent d92331e3b7
commit f2935b399b
No known key found for this signature in database
GPG key ID: 96D854C4833F2660

View file

@ -742,16 +742,22 @@ during the test are complete and you won't receive an error from Active Storage
saying it can't find a file.
```ruby
module ActionDispatch
class IntegrationTest
def remove_uploaded_files
FileUtils.rm_rf(Rails.root.join('tmp', 'storage'))
end
module RemoveUploadedFiles
def after_teardown
super
remove_uploaded_files
end
private
def remove_uploaded_files
FileUtils.rm_rf(Rails.root.join('tmp', 'storage'))
end
end
module ActionDispatch
class IntegrationTest
prepend RemoveUploadedFiles
end
end
```