public
Description: Some assertions for testing that fragment cache, and action cache is generated or expired
Homepage: http://github.com/ferblape/cache_test
Clone URL: git://github.com/ferblape/cache_test.git
name age message
file MIT-LICENSE Sat Sep 06 06:47:01 -0700 2008 updated README. License [ferblape]
file README.markdown Sat Sep 06 06:47:01 -0700 2008 updated README. License [ferblape]
file Rakefile Sat Sep 06 06:38:04 -0700 2008 First relase [ferblape]
file init.rb Sun Feb 08 22:28:20 -0800 2009 unnecessary include [ferblape]
directory lib/ Sun Feb 08 22:47:05 -0800 2009 Aliased action with params [ferblape]
directory test/ Sat Sep 06 06:38:04 -0700 2008 First relase [ferblape]
README.markdown

Cache Test

http://github.com/ferblape/cache_test

A plugin for testing generation and expiration of action cache and fragment cached. Based on cache test plugin

Example of usage

You can use all the new asserts in functional tests, in this way:

assert_cache_fragment({:fragment => 'total_posts'}) do
  get :index, :user_id => users(:first)
  assert_response :success
end

List of asserts

Testing action cache

Generation

  • assert_cache_action
  • assert_cache_actions
  • assert_not_cache_action
  • assert_not_cache_actions

Expiration

  • assert_expire_cache_action
  • assert_expire_cache_actions
  • assert_not_expire_cache_action
  • assert_not_expire_cache_actions

Testing fragment cache

Generation

  • assert_cache_fragment
  • assert_cache_fragments
  • assert_not_cache_fragment
  • assert_not_cache_fragments

Expiration

  • assert_expire_cache_fragment
  • assert_expire_cache_fragments
  • assert_not_expire_cache_fragment
  • assert_not_expire_cache_fragments

About

This plugin is inspired by cache_test, a great plugin that allowed you to test cache in Rails 1.x.

It was so useful for me that I decided to upgrade it to Rails 2.x and add some tests.

The test suite was extracted from the test suit of shoulda, another great plugin.

Copyright (c) 2008 Fernando Blat, released under the MIT license