Permalink
Browse files

failing test for :port/ bounces

  • Loading branch information...
1 parent 3f13cd4 commit 22a05b1013c4e5ed72a6a8bfd8e06da8e993492c @substack committed Feb 2, 2012
Showing with 9 additions and 2 deletions.
  1. +9 −2 test/bounce_url.js
View
@@ -32,12 +32,19 @@ test('bounce opts.path with a full url', function (t) {
});
});
-function testUrl (t, bouncer) {
+test('bounce with a root path', function (t) {
+ testUrl(t, function (port, req, bounce) {
+ bounce(':' + port + '/');
+ });
+});
+
+function testUrl (t, bouncer, target) {
t.plan(4);
+ if (!target) target = '/rewritten';
var p0 = Math.floor(Math.random() * (Math.pow(2,16) - 1e4) + 1e4);
var s0 = http.createServer(function (req, res) {
- t.equal(req.url, '/rewritten');
+ t.equal(req.url, target);
res.setHeader('content-type', 'text/plain');
res.write('beep boop');
res.end();

0 comments on commit 22a05b1

Please sign in to comment.