mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
ea43daa886
Extracted from https://github.com/rails/rails/pull/41543. In that PR, I introduce docs on how to test Active Storage in a variety of scenarios. One specific case is when you're doing parallel tests. To avoid the files uploaded / deleted in your tests from clashing with each other, you should have each test run with a separate storage directory. Currently `ActiveStorage::Service::DiskService#root` is readonly, which means that to do that you need to change it using `instance_variable_set`. This isn't very elegant. Given parallel tests and Active Storage are both turned on by default in Rails I think it makes sense to have a nice API for this. This PR just changes the `attr_reader` to an `attr_accessor`. With this change, the [code sample here](https://github.com/rails/rails/pull/41543/files#diff-e61fcdded4b6112b041ff388609c7032d09b8212ce209d67a7debc32f230d77aR1059-R1061) works. |
||
---|---|---|
.. | ||
azure_storage_public_service_test.rb | ||
azure_storage_service_test.rb | ||
configurations.example.yml | ||
configurations.yml.enc | ||
configurator_test.rb | ||
disk_public_service_test.rb | ||
disk_service_test.rb | ||
gcs_public_service_test.rb | ||
gcs_service_test.rb | ||
mirror_service_test.rb | ||
s3_public_service_test.rb | ||
s3_service_test.rb | ||
shared_service_tests.rb |