aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/caching_test.rb
diff options
context:
space:
mode:
authorLeonel Galán <leonel@getstealz.com>2017-04-03 22:59:43 -0400
committerGitHub <noreply@github.com>2017-04-03 22:59:43 -0400
commit8648f289f01656b2258687126108c389127108e0 (patch)
tree1ccb15f72f00d8c30497ad4e48f203545dd3383b /activesupport/test/caching_test.rb
parent28b3582aa2cd6007c708134b911b3f360ad5d659 (diff)
parente8c33349bfabca28996ac74d344d69c7aaffec50 (diff)
downloadrails-8648f289f01656b2258687126108c389127108e0.tar.gz
rails-8648f289f01656b2258687126108c389127108e0.tar.bz2
rails-8648f289f01656b2258687126108c389127108e0.zip
Merge branch 'master' into bug/filtered_parameters_class
Diffstat (limited to 'activesupport/test/caching_test.rb')
-rw-r--r--activesupport/test/caching_test.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/activesupport/test/caching_test.rb b/activesupport/test/caching_test.rb
index c543122d91..c67ffe69b8 100644
--- a/activesupport/test/caching_test.rb
+++ b/activesupport/test/caching_test.rb
@@ -47,6 +47,17 @@ module ActiveSupport
assert_raises(RuntimeError) { middleware.call({}) }
assert_nil LocalCacheRegistry.cache_for(key)
end
+
+ def test_local_cache_cleared_on_throw
+ 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"
+ throw :warden
+ })
+ assert_throws(:warden) { middleware.call({}) }
+ assert_nil LocalCacheRegistry.cache_for(key)
+ end
end
end
end