Makes sure your apache set up is working as you expect it to and check for regressions by running a suite of tests against it just as you would for any web application.
simply subclass HTTPRedirectTest in your tests and set the domain that you want to test
require 'http_redirect_test' class ExampleComTest < HTTPRedirectTest self.domain = "example.com" # rest of tests here end
you then have access to a bunch of macros to test various responses from your chosen site.
should_not_redirect "/index.html" # tests response is a 200OK should_redirect "/blog", :to => "/new/blog", :permanant => true # tests reponse is a 301 specifically should_redirect "/oldblog", :to => "/new/blog" # any kind of 3xx response should_be_gone "/410.html" # explicitly 410Gone should_not_be_found "/404.html" # explicitly 404
Inspired by a blog post by Patrick Reagan of Viget Labs, thanks man.