Spider Tester plugin
Plugin details
Documentation
Install the plugin:
ruby script/plugin install svn://caboo.se/plugins/court3nay/spider_test
USAGE
script/generate integration_test spider_test
Load up the test/integration/spider_test.rb and make it look something like this, replacing your own implementation details where appropriate. You'll probably want to load all of your fixtures.
require "#{File.dirname(__FILE__)}/../test_helper" class SpiderTest < ActionController::IntegrationTest fixtures :users, :roles, :images, :categories include Caboose::SpiderIntegrator def test_spider get '/' assert_response :success spider(@response.body, '/') end end
If you require a login for your app, you'll need to specifically log in. I do it like:
require "#{File.dirname(__FILE__)}/../test_helper" class SpiderTest < ActionController::IntegrationTest fixtures :users, :roles, :images, :categories include Caboose::SpiderIntegrator def test_spider get '/sessions/new' assert_response :success post '/sessions/create', :login => 'admin', :password => 'test' assert session[:user] assert_response :redirect assert_redirected_to '/' follow_redirect! spider(@response.body, '/', :verbose => true, :ignore_urls => ['/login', %r{^.+logout}, %r{^.+delete.?}, %r{^.+/destroy.?}], :ignore_forms => []) end end
Further Documentation
There is currently no advanced documentation for this plugin.
New documentationEdit plugin | (0 older versions) | Last edited by: scott, over 2 years ago


