2013-11-14 03:59:49 +00:00
|
|
|
|
2013-11-14 19:23:59 +00:00
|
|
|
var response = require('../context').response;
|
2013-11-14 03:59:49 +00:00
|
|
|
|
|
|
|
describe('res.etag', function(){
|
|
|
|
it('should not modify an etag with quotes', function(){
|
|
|
|
var res = response();
|
|
|
|
res.etag = '"asdf"';
|
|
|
|
res.header.etag.should.equal('"asdf"');
|
|
|
|
})
|
|
|
|
|
|
|
|
it('should not modify a weak etag', function(){
|
|
|
|
var res = response();
|
|
|
|
res.etag = 'W/"asdf"';
|
|
|
|
res.header.etag.should.equal('W/"asdf"');
|
|
|
|
})
|
|
|
|
|
|
|
|
it('should add quotes around an etag if necessary', function(){
|
|
|
|
var res = response();
|
|
|
|
res.etag = 'asdf';
|
|
|
|
res.header.etag.should.equal('"asdf"');
|
|
|
|
})
|
|
|
|
})
|