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
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
..
analyzer Fall back to video container for duration 2020-08-31 08:48:06 -04:00
controllers Active Storage representations: respond with 404 given invalid variation key 2021-03-27 08:03:27 -04:00
database touch parent model when an attachment is purged 2020-07-26 12:22:37 -05:00
dummy 'lookup' -> 'look up' in dummy webpacker.ymls 2021-03-21 12:36:56 +00:00
fixtures Improve Fixture support for Active Storage (#41065) 2021-01-24 11:10:30 +01:00
jobs Correct test class name 2019-09-28 10:31:26 -04:00
models Active Storage: upgrade to mini_mime 1.1.0 2021-04-04 22:44:02 -04:00
previewer Active Storage: raise PreviewError when a preview cannot be generated 2021-02-26 14:06:52 -05:00
service Add a public writer for ActiveStorage::Service::DiskService#root 2021-05-06 16:23:48 -05:00
template url -> URL where apt except inside actionpack/ 2019-04-01 22:56:35 +05:30
urls Respect default serving strategy in rails_{blob,representation}_{url,path} 2021-01-28 18:52:00 -05:00
fixture_set_test.rb Fix Flaky ActiveStorage test (#41225) 2021-01-24 18:29:11 +01:00
javascript_package_test.rb Enforce that activestorage compiled JS is in sync with source code 2019-10-18 18:02:02 -07:00
test_helper.rb Active Storage: Blob creation shouldn't crash if no service selected 2021-03-12 15:12:11 -05:00