Response Visualizer plugin

Plugin details

Enables rendering of the body of an HTTP response from inside a functional test. This makes it easy to diagnose problems when building assert_select statements or just sanity check the output of the test.

Websitehttp://matthewbass.com/2007/11/03/introducing-the-response_visualizer-plugin-for-rails/ Repositoryhttp://respvisualizer.rubyforge.org/svn/response_visualizer/ Tags Tests LicenseMIT

Documentation

Install the plugin:
ruby script/plugin install http://respvisualizer.rubyforge.org/svn/response_visualizer/

=== Usage

Insert the visualize_response method in your functional test immediately after an HTTP request has been sent:

  def test_new
    post :new
    visualize_response
    assert_select "div[id=header]"
  end



visualize_response attempts to open the response body in the default web browser. If you want to open the raw HTML in the default text editor instead, simply pass the :html symbol to the method:

  def test_new
    post :new
    visualize_response(:html)
    ...
  end



If you get tired of typing "visualize_response" everywhere, use the shortcut:

  def test_new
    post :new
    vr
    ...
  end



=== Compatibility

response_visualizer requires OS X. Subversion must be installed and accessible on the command line. Support for Windows is planned.

=== Running Unit Tests

Use the rake command to run the unit tests for the plugin. The tests require that the Mocha gem be installed locally:

  sudo gem install mocha

Further Documentation

There is currently no advanced documentation for this plugin.

New documentation

Edit plugin | (0 older versions) | Last edited by: scott, 6 months ago