Skip to content
Myr

res.cache.js

This file

Path

test/res.cache.js

23 lines · 534 bytes · JavaScript

Last changed by

Added res.cache(str)Tj Holowaychukbefore adoptioncaec590

History of this file

Take it

Added res.cache(str)Tj Holowaychukbefore adoptioncaec590

lines 1–23why, one step back
1
2var express = require('../')3 , request = require('./support/http');45describe('res', function(){6 describe('.cache(str)', function(){7 it('should set Cache-Control', function(done){8 var app = express();910 app.use(function(req, res){11 res.cache('public, max-age=3000').end('whoop');12 });1314 request(app)15 .get('/')16 .end(function(res){17 res.headers['cache-control'].should.equal('public, max-age=3000');18 res.body.should.equal('whoop');19 done();20 })21 })22 })23})