diff --git a/test/cookies.js b/test/cookies.js index cd42a35b..15812e98 100644 --- a/test/cookies.js +++ b/test/cookies.js @@ -1281,4 +1281,26 @@ describe('cookie', function () { }); }); }); + + describe('Cookie name case is respected', function () { + it('asserts true if cookie name contains capital letters', function () { + const app = express(); + app.get('/users', function(req, res) { + res.cookie('Alpha', 'one', { domain: 'domain.com', path: '/', httpOnly: true }); + res.send(200, { name: 'tobi' }); + }); + request(app) + .get('/users') + .expect('Content-Type', /json/) + .expect('Content-Length', '15') + .expect(200) + // assert 'Alpha' cookie is set with domain, path, and httpOnly options + .expect(cookies.set({ name: 'Alpha', options: ['domain', 'path', 'httponly'] })) + .end(function(err, res) { + if (err) { + throw err; + } + }); + }); + }); });