Skip to content

Commit

Permalink
[test] this should function but does not, encoded params are broken
Browse files Browse the repository at this point in the history
  • Loading branch information
Swaagie committed Dec 15, 2014
1 parent 81de1fb commit ac2fd0f
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/server/http/http-test.js
Expand Up @@ -38,6 +38,7 @@ vows.describe('director/http').addBatch({
"when passed to an http.Server instance": {
topic: function (router) {
router.get(/foo\/bar\/(\w+)/, handlers.respondWithId);
router.get(/add\/:param\/bark/, handlers.respondWithId);
router.get(/foo\/update\/(\w+)/, handlers.respondWithId);
router.path(/bar\/bazz\//, function () {
this.get(/(\w+)/, handlers.respondWithId);
Expand All @@ -53,6 +54,26 @@ vows.describe('director/http').addBatch({
"a request to bar/bazz/bark": assertBark('bar/bazz/bark'),
"a request to foo/bar/bark?test=test": assertBark('foo/bar/bark?test=test'),
"a request to foo/wild/bark": assertBark('foo/wild/bark'),
"a request to add/:param/bark": {
topic: function () {
request({ uri: 'http://localhost:9090/add/test/bark' }, this.callback);
},
'should respond and parse the params': function (err, res, body) {
assert.isNull(err);
assert.equal(res.statusCode, 200);
assert.equal(body, 'hello from (test)');
}
},
"an encoded request to add/:param/bark": {
topic: function () {
request({ uri: 'http://localhost:9090/add/something%40example.com/bark' }, this.callback);
},
'should respond and parse the params': function (err, res, body) {
assert.isNull(err);
assert.equal(res.statusCode, 200);
assert.equal(body, 'hello from (something%40example.com)');
}
},
"a request to foo/%RT": macros.assert404(9090, 'foo/%RT'),
"a request to /v2/somepath": macros.assertGet(
9090,
Expand Down

0 comments on commit ac2fd0f

Please sign in to comment.