Last active
August 29, 2015 14:16
-
-
Save teddevaal/d8cf62112442456fa3a0 to your computer and use it in GitHub Desktop.
Rspec caching
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
spec/features/awesome_cache_sweeper_spec.rb | |
it 'expires the awesome cache', :with_caching do | |
perform_your_caching_method | |
end | |
spec_helper.rb | |
config.around(:each, :with_caching) do |spec| | |
ActionController::Base.perform_caching = true | |
ActionController::Base.cache_store = :file_store, 'tmp/cache' | |
spec.run | |
Rails.cache.clear | |
ActionController::Base.perform_caching = false | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment