samedi 24 juin 2017

Is there a way to disable caching for specific Rails tests or code blocks?

When testing Rails code I often need to clear the cache behind conditions because the changes happen in less than a second, and the cache key uses second-precision timestamps (or use something like Timecop to skew the timestamps).

I know about using the null_store to disable caching across all tests, but I want to be able to test with caching as well. Is there a way to disable caching for specific tests or blocks of code?

Thanks in advance for any insight.

Aucun commentaire:

Enregistrer un commentaire