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. |
||
---|---|---|
.. | ||
analyzer | ||
controllers | ||
database | ||
dummy | ||
fixtures | ||
jobs | ||
models | ||
previewer | ||
service | ||
template | ||
urls | ||
fixture_set_test.rb | ||
javascript_package_test.rb | ||
test_helper.rb |