# script/plugin install svn://caboo.se/plugins/court3nay/spider_test
Then generate an integration test
# script/generate integration_test spider
Now put the essentials into your test
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
require "#{File.dirname(__FILE__)}/../test_helper" class SpiderTest < ActionController::IntegrationTest fixtures :all include Caboose::SpiderIntegrator def test_spider get '/account/login' assert_response :success post '/account/login', :login => 'quentin', :password => 'test' assert session[:user] assert_response :redirect assert_redirected_to '/' follow_redirect! spider(@response.body, '/', :ignore_urls => ['/login', %r{^.+logout}, %r{^.+delete.?}, %r{^.+/destroy.?}, :ignore_forms => [], :verbose => true) end end |
Sorry, comments are closed for this article.