tests: add test for signed cookie without secret

closes #2986
This commit is contained in:
Linus Unnebäck 2016-05-05 10:34:40 +02:00 committed by Douglas Christopher Wilson
parent f3d99a4fdb
commit bb84cf955f

View File

@ -150,6 +150,22 @@ describe('res', function(){
})
})
describe('signed without secret', function(){
it('should throw an error', function(done){
var app = express();
app.use(cookieParser());
app.use(function(req, res){
res.cookie('name', 'tobi', { signed: true }).end();
});
request(app)
.get('/')
.expect(500, /secret\S+ required for signed cookies/, done);
})
})
describe('.signedCookie(name, string)', function(){
it('should set a signed cookie', function(done){
var app = express();