Permalink
Browse files

more tests

  • Loading branch information...
1 parent 7befed9 commit f3da9946ffa7392e375186053e1e58f04b5e4452 @tj tj committed Jun 10, 2012
Showing with 15 additions and 2 deletions.
  1. +15 −2 test/fresh.js
View
@@ -27,7 +27,13 @@ describe('fresh(reqHeader, resHeader)', function(){
})
})
- xdescribe('when etag is missing');
+ describe('when etag is missing', function(){
+ it('should be stale', function(){
+ var req = { 'if-none-match': 'tobi' };
+ var res = {};
+ fresh(req, res).should.be.false;
+ })
+ })
})
describe('when requested with If-Modified-Since', function(){
@@ -49,9 +55,16 @@ describe('fresh(reqHeader, resHeader)', function(){
})
})
+ describe('when last-modified is missing', function(){
+ it('should be stale', function(){
+ var req = { 'if-none-match': new Date().toUTCString() };
+ var res = {};
+ fresh(req, res).should.be.false;
+ })
+ })
+
xdescribe('with invalid if-modified-since date');
xdescribe('with invalid modified-since date');
- xdescribe('when last-modified is missing');
})
describe('when requested with If-Modified-Since and If-None-Match', function(){

0 comments on commit f3da994

Please sign in to comment.