Permalink
Browse files

added a test to ensure that "" is matched before "/" for a `pathInfo`…

… of ""
  • Loading branch information...
1 parent 22d20c4 commit d6cf8aad86117d74f491a72fc62a6f6c0b989928 @nrstott committed Oct 6, 2011
Showing with 20 additions and 0 deletions.
  1. +20 −0 test/router.test.js
View
20 test/router.test.js
@@ -256,3 +256,23 @@ exports['test matches empty `pathInfo` to "/" if no route is defined for ""'] =
assert.equal('success', response.body);
});
};
+
+exports['test matches empty `pathInfo` to "" if a route is defined for ""'] = function(beforeExit) {
+ var router
+ , response;
+
+ router = bogart.router();
+ router.get('', function(req) {
+ return bogart.text('right');
+ });
+
+ router.get('/', function(req) {
+ return bogart.text('wrong');
+ });
+
+ response = router(getMock(''));
+
+ beforeExit(function() {
+ assert.equal('right', response.body);
+ });
+};

0 comments on commit d6cf8aa

Please sign in to comment.