Sha256: 74bf2c1b51814cf78315ce070c19206458b54fe2601e0a74f1565591ef871959

Contents?: true

Size: 1.3 KB

Versions: 110

Compression:

Stored size: 1.3 KB

Contents

# module Spree
#   module TestingSupport
#     module Caching
      # def cache_writes
      #   @cache_write_events
      # end

      # def assert_written_to_cache(key)
      #   unless @cache_write_events.detect { |event| event[:key].starts_with?(key) }
      #     raise %Q{Expected to find #{key} in the cache, but didn't.

  # Cache writes:
  # #{@cache_write_events.join("\n")}
      #     }
      #   end
      # end

      # def clear_cache_events
      #   @cache_read_events = []
      #   @cache_write_events = []
      # end
    # end
  # end
# end

# RSpec.configure do |config|
  # config.include Spree::TestingSupport::Caching, caching: true

  # config.before(:each, caching: true) do
    # ActionController::Base.perform_caching = true

    # ActiveSupport::Notifications.subscribe('read_fragment.action_controller') do |_event, _start_time, _finish_time, _, details|
    #   @cache_read_events ||= []
    #   @cache_read_events << details
    # end

    # ActiveSupport::Notifications.subscribe('write_fragment.action_controller') do |_event, _start_time, _finish_time, _, details|
    #   @cache_write_events ||= []
    #   @cache_write_events << details
    # end
  # end

  # config.after(:each, caching: true) do
    # ActionController::Base.perform_caching = false
    # Rails.cache.clear
  # end
# end

Version data entries

110 entries across 110 versions & 1 rubygems

Version Path
spree_core-4.2.4 lib/spree/testing_support/caching.rb
spree_core-3.7.14.1 lib/spree/testing_support/caching.rb
spree_core-4.2.3.1 lib/spree/testing_support/caching.rb
spree_core-4.1.13.1 lib/spree/testing_support/caching.rb
spree_core-4.0.7.1 lib/spree/testing_support/caching.rb
spree_core-4.2.3 lib/spree/testing_support/caching.rb
spree_core-4.2.2 lib/spree/testing_support/caching.rb
spree_core-4.2.1 lib/spree/testing_support/caching.rb
spree_core-4.0.7 lib/spree/testing_support/caching.rb
spree_core-3.7.14 lib/spree/testing_support/caching.rb
spree_core-4.2.0 lib/spree/testing_support/caching.rb
spree_core-4.2.0.rc5 lib/spree/testing_support/caching.rb
spree_core-4.2.0.rc4 lib/spree/testing_support/caching.rb
spree_core-4.2.0.rc3 lib/spree/testing_support/caching.rb
spree_core-4.1.13 lib/spree/testing_support/caching.rb
spree_core-4.0.6 lib/spree/testing_support/caching.rb
spree_core-4.2.0.rc2 lib/spree/testing_support/caching.rb
spree_core-3.7.13 lib/spree/testing_support/caching.rb
spree_core-4.0.5 lib/spree/testing_support/caching.rb
spree_core-4.1.12 lib/spree/testing_support/caching.rb