From 19e3384bb17a3399fc5224b8d83c6564e8e1ca04 Mon Sep 17 00:00:00 2001 From: Tj Holowaychuk Date: Thu, 24 Nov 2011 12:34:47 -0800 Subject: [PATCH] Added test for res.sendfile() with non-GET. Closes #723 --- test/fixtures/name.txt | 1 + test/res.sendfile.js | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 test/fixtures/name.txt diff --git a/test/fixtures/name.txt b/test/fixtures/name.txt new file mode 100644 index 00000000..fa66f37f --- /dev/null +++ b/test/fixtures/name.txt @@ -0,0 +1 @@ +tobi \ No newline at end of file diff --git a/test/res.sendfile.js b/test/res.sendfile.js index 1837894f..68d24998 100644 --- a/test/res.sendfile.js +++ b/test/res.sendfile.js @@ -192,6 +192,22 @@ describe('res', function(){ done(); }); }) + + describe('with non-GET', function(){ + it('should still serve', function(done){ + var app = express() + , calls = 0; + + app.use(function(req, res){ + res.sendfile(__dirname + '/fixtures/name.txt'); + }); + + + request(app) + .get('/') + .expect('tobi', done); + }) + }) }) }) })