Rails Page Cache Test Plugin 0.2
Rails Page Cache Test Plugin adds two assertions to the Test::Units::TestCase class of Ruby on Rails to check the caching and expirin
|
|||||||||||||||||||
Rails Page Cache Test Plugin adds two assertions to the Test::Units::TestCase class of Ruby on Rails to check the caching and expiring of pages in integration tests.
Installation:
Unpack into the vendor/plugin and that should be it.
Usage:
First create an integration test. Then, to test caching of the "/pages/about" and "/pages/contact" pages, add a method like this:
def test_caching
assert_cache("/pages/about", "/pages/contact")
end
The assert_cache method will
You can also give a block to the assert_cache method. Instead of executing a get on each url, it will yield the urls. For example:
def test_caching
assert_cache("/pages/about",
"/pages/contact") do |url_about, url_contact|
post url_about
post url_contact
end
end
You will also certainly want (and that's really the most interesting part) to check if your cached pages expires when the user is doing some action. For that, here is the assert_expire method:
def test_expiring
assert_expire("/news/list", "/news/show/1") do |*urls|
post "/news/delete/1"
end
end
Here the assert_expire method will
This is great for testing your cache sweepers logic.
What's New in This Release:
tags
Download Rails Page Cache Test Plugin 0.2
Authors software
|
|
Similar software
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Other software in this category
|
|
|
|
|
|
|
|
|
|
Featured Software
jEdit 4.3 pre8
jEdit is an Open Source text editor written in Java
Opera 9.02
Surf the Internet in a safer, faster, and easier way with Opera browser
GNU Aspell 0.60.4
GNU Aspell is a Free and Open Source spell checker designed to eventually replace Ispell
- Communications
- Database
- Desktop Environment
- Games
- Internet
- Multimedia
- Office
- Programming
- Science and Engineering
- System
- Text Editing&Processing
