RSpec.configure do |config|
helpers = Module.new do
def without_cache(key, options = {}, &block) - without_cache doesn't depend on instance state (maybe move it to another class?)
value = Rails.cache.read(key) -
Rails.cache.delete(key) -
-
yield
ensure
Rails.cache.delete(key) -
-
Rails.cache.write(key, value, options) -
end
end
config.include helpers
end