diff options
author | Santosh Wadghule <santosh.wadghule@gmail.com> | 2016-07-14 12:38:07 +0530 |
---|---|---|
committer | Santosh Wadghule <santosh.wadghule@gmail.com> | 2016-07-17 20:06:37 +0530 |
commit | 2d78a3ae86f9f825f90a72de2693c567ecb5c4bd (patch) | |
tree | b8164d69c13b7e9435d7e8996067b168354e8457 | |
parent | a1ac08c2d9646e145d8f8f9734faa9a1d1f8ebbe (diff) | |
download | rails-2d78a3ae86f9f825f90a72de2693c567ecb5c4bd.tar.gz rails-2d78a3ae86f9f825f90a72de2693c567ecb5c4bd.tar.bz2 rails-2d78a3ae86f9f825f90a72de2693c567ecb5c4bd.zip |
Add missing test for clearing up local cache on invalid parameters err.
Add missing test for clearing up local cache and check response should
be present on invalid parameters error.
-rw-r--r-- | activesupport/test/caching_test.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/activesupport/test/caching_test.rb b/activesupport/test/caching_test.rb index 8002c14539..1e3810f6f7 100644 --- a/activesupport/test/caching_test.rb +++ b/activesupport/test/caching_test.rb @@ -25,6 +25,18 @@ module ActiveSupport assert_nil LocalCacheRegistry.cache_for(key) end + def test_local_cache_cleared_and_response_should_be_present_on_invalid_parameters_error + key = "super awesome key" + assert_nil LocalCacheRegistry.cache_for key + middleware = Middleware.new('<3', key).new(->(env) { + assert LocalCacheRegistry.cache_for(key), 'should have a cache' + raise Rack::Utils::InvalidParameterError + }) + response = middleware.call({}) + assert response, 'response should exist' + assert_nil LocalCacheRegistry.cache_for(key) + end + def test_local_cache_cleared_on_exception key = "super awesome key" assert_nil LocalCacheRegistry.cache_for key |