Linux SoftwareProgrammingLibrariesRails Page Cache Test Plugin 0.2

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
Developer:   canatella
      more software by author →
Price:  0.00
License:   MIT/X Consortium License
File size:   9K
Language:   
OS:   
Rating:   0 /5 (0 votes)
Your vote:  
enlarge screenshot


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

  • first make sure that the urls are not cached,
  • execute a get on each request,
  • assert that the corresponding cache files have been created.

    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

  • check that the urls are cached,
  • execute the post request,
  • and assert that the urls are no more cached.

    This is great for testing your cache sweepers logic.

    What's New in This Release:
  • This release adds a test for action and fragment caching.
  • The plugin does not look at the filesystem anymore to see if page are cached or not.
  • It hijacks the ActionController::Base page caching methods to store which pages are cached and expired, and uses that information for the assertions.
    tags the assert  that the  the urls  assert cache  assert expire  urls are  are cached  pages contact  def test  pages about  test caching  post url  end end  

    Download Rails Page Cache Test Plugin 0.2


     http://www.cosinux.org/~dam/projects/page-cache-test/cache_test-0.2.tar.bz2


    Authors software

    Rails Page Cache Test Plugin 0.2 (by canatella)
    Rails Page Cache Test Plugin adds two assertions to the Test::Units::TestCase class of Ruby on Rails to check the caching and expirin


    Similar software

    Rails Page Cache Test Plugin 0.2 (by canatella)
    Rails Page Cache Test Plugin adds two assertions to the Test::Units::TestCase class of Ruby on Rails to check the caching and expirin

    Template::Tutorial 2.15 (by Andy Wardley)
    Template::Tutorial are template toolkit tutorials.

    This section includes tutorials on using the Template Toolkit

    History links 1.3 (by Vladimir Kudryavtsev)
    This class can be used to keep track of the pages navigated by a user, so it can generate back or next links providing a similar effe

    Rails History Plugin 0.2 (by Damien Merenne)
    Rails History Plugin is a Ruby on Rails plugin that stores user actions (i.e

    Lohimedia 0.4.0 (by Lohimedia Team)
    Lohimedia project is a wiki based on the open source model of development.

    Instead of allowing anyone to edit and release any arti

    MathML::Entities 0.13 (by Jacques Distler)
    MathML::Entities is a Perl module that can convert XHTML+MathML Named Entities to Numeric Character References.

    SYNOPSIS

    use M

    Zero Install 0.1.27 (by Thomas Leonard)
    The Zero Install system makes software installation not merely easy, but unnecessary

    Skycache 2.2 (by Skycache Team)
    Skycache is a lightweight, free and fast page cache for PHP 4 and PHP 5.

    Once a dynamic page has been computed, it is stored in a

    mod_murka 0.8 (by Alex Esterkin)
    mod_murka creates a convenient apache, xml, xsl based web publishing environment

    WWWOFFLE 2.9a (by amb)
    wwwoffled application is a simple proxy server with special features for use with dial-up internet links.

    This means that it is po


    Other software in this category

    zlib 1.2.3 (by Jean-loup Gailly)
    zlib is designed to be a free, general-purpose, legally unencumbered, lossless data-compression library for use on virtually any comp

    libjpeg v6b (by Independent JPEG Group)
    libjpeg is a library for handling the JPEG (JFIF) image format

    OpenSSL 0.9.7c (by The OpenSSL Project Team)
    The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implement

    libxml2 2.6.27 (by DV)
    Libxml2 is the XML C parser and toolkit developed for the Gnome project (but usable outside of the Gnome platform), libxml2 library i

    GNU C library 2.4 (by Andreas Jaeger)
    GNU C library (glibc) is one of the most important components of GNU Hurd and most modern Linux distributions.

    GNU C library is us

  •     search


    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


    Subscribe in Rojo
    Google Reader
    Add to My Yahoo!

    Add to My AOL
    Subscribe with Bloglines
    Subscribe in NewsGator Online
    Add 'nixbit linux software' to Newsburst from CNET News.com
    del.icio.us nixbit linux software


    Top tags