Sha256: fade98a5d0e95ee54cce532d34b7d8b715ff71be7a53e47f38571af000c7de3d

Contents?: true

Size: 719 Bytes

Versions: 1

Compression:

Stored size: 719 Bytes

Contents

require 'spec_helper'

describe HighVoltage::PagesController, 'action_caching' do
  it 'caches the action when action_caching is set to true', enable_caching: true do
    HighVoltage.action_caching = true

    load('high_voltage/pages_controller.rb')
    get :show, id: 'exists'

    action_was_cached(:exists).should be_true
  end

  it 'does not cache the action when action_caching is set to false', enable_caching: true do
    HighVoltage.action_caching = false

    load('high_voltage/pages_controller.rb')
    get :show, id: 'exists'

    action_was_cached(:exists).should be_false
  end

  def action_was_cached(page)
    ActionController::Base.cache_store.exist?("views/test.host#{page_path(page)}")
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
high_voltage-1.2.4 spec/controllers/action_caching_controller_spec.rb