dalli is a client for the caching service (memcached) set it globally whatever the environment, ie in your config/application.rb
config.cache_store = :dalli_store
caching being deactivated in the test environment is a common approach, check config/environments/test.rb
config.action_controller.perform_caching = false
so you can enable it for the test environment, but it could lead to some weird conflicts best is probably to enable it on the go for a specific specs only:
before do # enable caching
@caching_state = ActionController::Base.perform_caching
ActionController::Base.perform_caching = true
end
after do # disable caching
ActionController::Base.perform_caching = @caching_state
end