Skip to content
Myr

req.fresh.js

This file

Path

test/req.fresh.js

35 lines · 781 bytes · JavaScript

Last changed by

Not known.

History of this file

Take it

The walk stopped after 200 commits: lines older than 8ac3e80 point at it.

Merge branch 'master' of github.com:visionmedia/expressTJ Holowaychukbefore adoption8ac3e80

lines 1–35why, one step back
1
2var express = require('../')3 , request = require('./support/http');45describe('req', function(){6 describe('.fresh', function(){7 it('should return true when the resource is not modified', function(done){8 var app = express();910 app.use(function(req, res){11 res.set('ETag', '12345');12 res.send(req.fresh);13 });1415 request(app)16 .get('/')17 .set('If-None-Match', '12345')18 .expect(304, done);19 })2021 it('should return false when the resource is modified', function(done){22 var app = express();2324 app.use(function(req, res){25 res.set('ETag', '123');26 res.send(req.fresh);27 });2829 request(app)30 .get('/')31 .set('If-None-Match', '12345')32 .expect('false', done);33 })34 })35})