This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
cache_test / README.markdown
| 0af26985 » | ferblape | 2008-09-06 | 1 | # Cache Test | |
| 2 | |||||
| 3 | <http://github.com/ferblape/cache_test> | ||||
| 4 | |||||
| 5 | A plugin for testing generation and expiration of action cache and fragment cached. Based on [cache test plugin](http://blog.cosinux.org/pages/page-cache-test) | ||||
| 6 | |||||
| 7 | |||||
| 8 | ## Example of usage | ||||
| 9 | |||||
| 10 | You can use all the new asserts in functional tests, in this way: | ||||
| 11 | |||||
| 12 | assert_cache_fragment({:fragment => 'total_posts'}) do | ||||
| 13 | get :index, :user_id => users(:first) | ||||
| 14 | assert_response :success | ||||
| 15 | end | ||||
| 16 | |||||
| 17 | |||||
| 18 | ## List of asserts | ||||
| 19 | |||||
| 20 | ### Testing action cache | ||||
| 21 | |||||
| 22 | #### Generation | ||||
| 23 | |||||
| 24 | - `assert_cache_action` | ||||
| 25 | - `assert_cache_actions` | ||||
| 26 | - `assert_not_cache_action` | ||||
| 27 | - `assert_not_cache_actions` | ||||
| 28 | |||||
| 29 | #### Expiration | ||||
| 30 | |||||
| 31 | - `assert_expire_cache_action` | ||||
| 32 | - `assert_expire_cache_actions` | ||||
| 33 | - `assert_not_expire_cache_action` | ||||
| 34 | - `assert_not_expire_cache_actions` | ||||
| 35 | |||||
| 36 | ### Testing fragment cache | ||||
| 37 | |||||
| 38 | #### Generation | ||||
| 39 | |||||
| 40 | - `assert_cache_fragment` | ||||
| 41 | - `assert_cache_fragments` | ||||
| 42 | - `assert_not_cache_fragment` | ||||
| 43 | - `assert_not_cache_fragments` | ||||
| 44 | |||||
| 45 | #### Expiration | ||||
| 46 | |||||
| 47 | - `assert_expire_cache_fragment` | ||||
| 48 | - `assert_expire_cache_fragments` | ||||
| 49 | - `assert_not_expire_cache_fragment` | ||||
| 50 | - `assert_not_expire_cache_fragments` | ||||
| 51 | |||||
| 52 | ## About | ||||
| 53 | |||||
| 54 | This plugin is inspired by [cache_test](http://blog.cosinux.org/pages/page-cache-test), a great plugin that allowed you to test cache in Rails 1.x. | ||||
| 55 | |||||
| 56 | It was so useful for me that I decided to upgrade it to Rails 2.x and add some tests. | ||||
| 57 | |||||
| 58 | The test suite was extracted from the test suit of [shoulda](http://github.com/thoughtbot/shoulda), another great plugin. | ||||
| 59 | |||||
| 60 | Copyright (c) 2008 [Fernando Blat](http://www.inwebwetrust.net), released under the MIT license | ||||







