2 solutions...
If you want caching on in test mode (good way to test it is doing what
you expect) you can simply clear the cache between tests.
def setup
Rails.cache.clear
end
Or you can write a cache that doesn't store anything.
put this in lib/active_support/cache/no_store.rb
module ActiveSupport
module Cache
class NoStore < Store
def read_entry(name, options)
return nil
end
def write_entry(name, value, options)
end
def delete_entry(name, options)
end
end
end
end
then add config.cache_store = :no_store to your test.rb file.