Stubbing Rails.cache.fetch in Minitest
If you've got some code that's calling Rails.cache.fetch and you want to test that it's working properly, you can use the following method helper to stub the cache:
def stub_rails_cache(&block)
@cache = {}
cache_strategy = ->(key, &block)