diff options
Diffstat (limited to 'spec/spec_helper.rb')
-rw-r--r-- | spec/spec_helper.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 4f3aacf55be..2e2aa7c4fc0 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -42,6 +42,13 @@ RSpec.configure do |config| config.before(:suite) do TestEnv.init end + + config.around(:each, :caching) do |example| + caching_store = Rails.cache + Rails.cache = ActiveSupport::Cache::MemoryStore.new if example.metadata[:caching] + example.run + Rails.cache = caching_store + end end FactoryGirl::SyntaxRunner.class_eval do |