Permalink
Browse files

Added a test for the option of not following redirects.

  • Loading branch information...
slaskis committed Jul 15, 2011
1 parent 5b07b1f commit 0a5b4072f43e76ceb9673ba8f6b5a87614fcf3a0
Showing with 11 additions and 0 deletions.
  1. +11 −0 test/test-open-uri.js
View
@@ -231,6 +231,17 @@ exports["GET a redirect with a relative Location"] = function(beforeExit){
beforeExit(function(){assert.ok(loaded)})
}
+exports["GET a redirect with a relative Location without 'follow'"] = function(beforeExit){
+ var loaded = false;
+ open("http://golang.org/cmd/5a",{follow:false},function(err,go,res){
+ loaded = true
+ assert.ifError(err)
+ assert.equal(res.statusCode,301)
+ assert.includes(go,'Moved Permanently')
+ })
+ beforeExit(function(){assert.ok(loaded)})
+}
+
exports["Chain it"] = function(beforeExit){
var stream = writeStream();
var loaded = false;

0 comments on commit 0a5b407

Please sign in to comment.