Skip to content

Commit 19e3384

Browse files
committedNov 24, 2011
Added test for res.sendfile() with non-GET. Closes expressjs#723
1 parent 6ae32fd commit 19e3384

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed
 

‎test/fixtures/name.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
tobi

‎test/res.sendfile.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,22 @@ describe('res', function(){
192192
done();
193193
});
194194
})
195+
196+
describe('with non-GET', function(){
197+
it('should still serve', function(done){
198+
var app = express()
199+
, calls = 0;
200+
201+
app.use(function(req, res){
202+
res.sendfile(__dirname + '/fixtures/name.txt');
203+
});
204+
205+
206+
request(app)
207+
.get('/')
208+
.expect('tobi', done);
209+
})
210+
})
195211
})
196212
})
197213
})

0 commit comments

Comments
 (0)