1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activestorage/test/service
Alex Ghiculescu ea43daa886 Add a public writer for ActiveStorage::Service::DiskService#root
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.
2021-05-06 16:23:48 -05:00
..
azure_storage_public_service_test.rb Ensure direct uploads to a public S3 service have a public ACL 2020-04-28 15:42:17 -04:00
azure_storage_service_test.rb
configurations.example.yml
configurations.yml.enc
configurator_test.rb
disk_public_service_test.rb
disk_service_test.rb Add a public writer for ActiveStorage::Service::DiskService#root 2021-05-06 16:23:48 -05:00
gcs_public_service_test.rb Revert "Set a public ACL for files uploaded to a public GCS service" 2020-04-28 17:16:47 -04:00
gcs_service_test.rb Revert "Set a public ACL for files uploaded to a public GCS service" 2020-04-28 17:16:47 -04:00
mirror_service_test.rb
s3_public_service_test.rb Ensure direct uploads to a public S3 service have a public ACL 2020-04-28 15:42:17 -04:00
s3_service_test.rb Fix S3 multipart uploads when threshold is larger than file 2020-12-11 16:26:40 -05:00
shared_service_tests.rb Use image/jpeg instead of non-standard image/jpg 2021-03-05 13:14:11 -05:00