markevans/dragonfly — Issue #159: Don't print debug info from Rack::Cache
Author: dnagir
Created: 2012-01-18 01:51:43+00:00
State: open

Running the cucumber features prints out the log info into the terminal after each step:

```cucumber
Given a company "External" exists with manager "boss@example.com" # features/step_definitions/company_steps.rb:39
cache: [GET /participations/new] miss
cache: [GET /assets/application.css] stale, valid, store
cache: [GET /assets/application.js] stale, valid, store
cache: [POST /participations] invalidate, pass
cache: [GET /participations/1112] miss
cache: [GET /assets/application.css] stale, valid, store
cache: [GET /assets/application.js] stale, valid, store
Given I add user "boss@example.com" into "External Networks" with access to future developments # features/step_definitions/participation_steps.rb:85
cache: [GET /developments/new] miss
cache: [GET /assets/application.css] stale, valid, store
cache: [GET /assets/application.js] stale, valid, store
cache: [POST /developments] invalidate, pass
cache: [GET /developments/170] miss
cache: [GET /assets/application.css] stale, valid, store
cache: [GET /assets/application.js] stale, valid, store
```

The expected output should be just 2 steps:

```cucumber
Given a company "External" exists with manager "boss@example.com" # features/step_definitions/company_steps.rb:39
Given I add user "boss@example.com" into "External Networks" with access to future developments # features/step_definitions/participation_steps.rb:85
```

The reason for this is that by default `Rack::Cache` has `:verbose => true`.
This only happens when Dragonfly is used.

I assume Dragonfly inserts `Rack::Cache` by default with some defaults.

The workaround for Rails is currently to set:

```ruby
# config/environments/test.rb

config.action_controller.perform_caching = true
config.action_dispatch.rack_cache = {:metastore => "rails:/", :entitystore => "rails:/", :verbose => false}
```

Which makes Rack::Cache available and Dragonfly can probably use it instead using its own.

But I'm not sure that this workaround is a correct/good one as the Cache store for Dragonfly would go to rails.