Sha256: 18738998a08551972afbf7fc95be2fee340e723c76361dfbc375b5aee11be0e7

Contents?: true

Size: 749 Bytes

Versions: 1

Compression:

Stored size: 749 Bytes

Contents

require 'spec_helper'

describe HighVoltage::PagesController, '#action_caching' do
  let(:page_name) { :exists }

  context 'action_caching set to true' do
    it 'caches the action', enable_caching: true do
      HighVoltage.action_caching = true
      concern_reload

      expect { get :show, id: page_name }.to change { action_cache_exists? }
    end
  end

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

      expect { get :show, id: page_name }.to_not change { action_cache_exists? }
    end
  end

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

Version data entries

1 entries across 1 versions & 1 rubygems

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