Skip to content
This repository has been archived by the owner on Dec 19, 2018. It is now read-only.

Commit

Permalink
README
Browse files Browse the repository at this point in the history
  • Loading branch information
eightbitraptor committed Oct 21, 2010
1 parent 9c1b5fd commit ed56a86
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions README.md
@@ -0,0 +1,27 @@
http\_redirect\_test
==================

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.

Example
-------

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



0 comments on commit ed56a86

Please sign in to comment.