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:
parent
d92331e3b7
commit
f2935b399b
1 changed files with 14 additions and 8 deletions
|
@ -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
|
||||
```
|
||||
|
|
Loading…
Reference in a new issue