This repository has been archived by the owner on Dec 19, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9c1b5fd
commit ed56a86
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
||
|
||
|