Permalink
Browse files

Added two new tests for URLs containing query strings.

  • Loading branch information...
1 parent 0a29a79 commit fe0767727590cd4a880f594e5e47ec8ba5c91de9 @thedjinn thedjinn committed Aug 20, 2010
Showing with 45 additions and 0 deletions.
  1. +45 −0 tests/test-index.js
View
@@ -48,3 +48,48 @@ exports["'GET /folder/' returns 200, text of /folder/index.html"] = function(tes
);
});
};
+exports["'GET /folder?param1=value1&param2=value2' returns '302 Found: http://examplevirtualhost.com/folder/'"] = function(test) {
+ antinode.start(settings, function() {
+ test_http(test,
+ {
+ 'method':'GET',
+ 'pathname':'/folder?param1=value1&param2=value2',
+ 'headers': {
+ 'host': 'examplevirtualhost.com'
+ }
+ },
+ {
+ 'statusCode':302,
+ 'body':'',
+ 'headers': {
+ 'location': 'http://examplevirtualhost.com/folder/?param1=value1&param2=value2'
+ }
+ },
+ function() {
+ antinode.stop();
+ test.done();
+ }
+ );
+ });
+};
+exports["'GET /folder/?param1=value1&param2=value2' returns 200, text of /folder/index.html"] = function(test) {
+ antinode.start(settings, function() {
+ test_http(test,
+ {
+ 'method':'GET',
+ 'pathname':'/folder/?param1=value1&param2=value2',
+ 'headers': {
+ 'host': 'examplevirtualhost.com'
+ }
+ },
+ {
+ 'statusCode':200,
+ 'body':indexText
+ },
+ function() {
+ antinode.stop();
+ test.done();
+ }
+ );
+ });
+};

0 comments on commit fe07677

Please sign in to comment.