diff options
author | George Claghorn <george.claghorn@gmail.com> | 2017-12-02 22:43:28 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-02 22:43:28 -0500 |
commit | 8c5a7fbefd3cad403e7594d0b6a5488d80d4c98e (patch) | |
tree | 837dc872b3769a9ec4e08096c0ef2847288f64ba /activestorage/test/service | |
parent | b23e381c89aa91451d73d3a1b1b6e4cbe7bc7780 (diff) | |
download | rails-8c5a7fbefd3cad403e7594d0b6a5488d80d4c98e.tar.gz rails-8c5a7fbefd3cad403e7594d0b6a5488d80d4c98e.tar.bz2 rails-8c5a7fbefd3cad403e7594d0b6a5488d80d4c98e.zip |
Purge variants with their blobs
Diffstat (limited to 'activestorage/test/service')
-rw-r--r-- | activestorage/test/service/shared_service_tests.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/activestorage/test/service/shared_service_tests.rb b/activestorage/test/service/shared_service_tests.rb index ade91ab89a..ce28c4393a 100644 --- a/activestorage/test/service/shared_service_tests.rb +++ b/activestorage/test/service/shared_service_tests.rb @@ -75,5 +75,22 @@ module ActiveStorage::Service::SharedServiceTests @service.delete SecureRandom.base58(24) end end + + test "deleting by prefix" do + begin + @service.upload("a/a/a", StringIO.new(FIXTURE_DATA)) + @service.upload("a/a/b", StringIO.new(FIXTURE_DATA)) + @service.upload("a/b/a", StringIO.new(FIXTURE_DATA)) + + @service.delete_prefixed("a/a/") + assert_not @service.exist?("a/a/a") + assert_not @service.exist?("a/a/b") + assert @service.exist?("a/b/a") + ensure + @service.delete("a/a/a") + @service.delete("a/a/b") + @service.delete("a/b/a") + end + end end end |