tests: use supertest to check response header values

closes #2983
closes #2992
This commit is contained in:
Douglas Christopher Wilson
2016-05-10 12:34:26 -04:00
committed by Linus Unnebäck
parent 8931b2311a
commit 12bc16e72f
10 changed files with 81 additions and 127 deletions

View File

@@ -2,6 +2,7 @@
var express = require('../')
, request = require('supertest')
, assert = require('assert');
var utils = require('./support/utils');
describe('res', function(){
describe('.jsonp(object)', function(){
@@ -136,11 +137,8 @@ describe('res', function(){
request(app)
.get('/')
.expect('Content-Type', 'application/vnd.example+json; charset=utf-8')
.expect(200, '{"hello":"world"}', function (err, res) {
if (err) return done(err);
res.headers.should.not.have.property('x-content-type-options');
done();
});
.expect(utils.shouldNotHaveHeader('X-Content-Type-Options'))
.expect(200, '{"hello":"world"}', done);
})
it('should override previous Content-Types with callback', function(done){