I'm using fragment caches pretty extensively and have ran into a few gotchas where unexpected objects got caught in the cache and/or the fragment didn't expire as originally planned.
I think this would be a prime candidate for request specs but am not sure of:
- What would need to be done to simulate a scenario where a cache is triggered (efficiently).
- What adjustments would need to be done in the test environment to allow for cacheing.
- Would the cache persist across multiple specs or would rspec automatically discard the cache between each spec?
- Most importantly, is there a method to determine if the cache was actually served?