huacnlee / rails-settings-cached

Global settings for your Rails application.
Other
1.06k stars 202 forks source link

Add info regarding test/dev cache sharing to README.md #114

Closed Lockyy closed 5 years ago

Lockyy commented 8 years ago

The default caching system in rails is ActiveSupport::Cache::FileStore. This means that cached values are shared between development and test environments as well as not correctly clearing the cache between test specs. To avoid this we can set the dev and test envs to use ActiveSupport::Cache::MemoryStore

This issue has been mentioned previously in https://github.com/huacnlee/rails-settings-cached/issues/1 as well as on SO and on the Rails repo regarding inaccurate documentation here.

codecov-io commented 8 years ago

Current coverage is 97.32%

Merging #114 into master will not change coverage

@@             master       #114   diff @@
==========================================
  Files            11         11          
  Lines           336        336          
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
  Hits            327        327          
  Misses            9          9          
  Partials          0          0          

Powered by Codecov. Last updated by afaffce...5f92ed6

runephilosof commented 8 years ago

It should probably also say something about adding Rails.cache.clear to your after(:each) or teardown in your specs/tests. Or suggest :null_store for tests