added test for res.sendfile() content-type override

This commit is contained in:
Tj Holowaychuk
2011-12-20 13:32:39 -08:00
parent e60f4a5e1e
commit 8e3cb6174d

View File

@@ -46,7 +46,23 @@ describe('res', function(){
done();
});
})
it('should not override manual content-types', function(done){
var app = express();
app.use(function(req, res){
res.contentType('txt');
res.sendfile('test/fixtures/user.html');
});
request(app)
.get('/')
.end(function(res){
res.should.have.header('content-type', 'text/plain');
done();
});
})
it('should invoke the callback on 403', function(done){
var app = express()
, calls = 0;