提交 8a0b3ca8 编写于 作者: R Rafael França 提交者: GitHub

Merge pull request #25822 from mechanicles/clear-local-cache-on-invalid-parameters-error

Add missing test for clearing up local cache on invalid parameters error.
......@@ -25,6 +25,18 @@ def test_local_cache_cleared_on_close
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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册