How should one test caches_page?
I开发者_JS百科n a Ror3 project, how would be an elegant way to test if caches_page works as expected in my controllers?
If you want to see if the page was cached, you can check for the file in your public folder. Rails will output a page with a .html extension. If you want to check a subsequent request, then maybe store the original response html (that was cached) and compare that against the subsequent request. Or possibly use the timestamp on the cached file (although I can see that being problematic). Are you looking for a specific implementation in rspec, cucumber, etc..?
精彩评论