Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

more tests

  • Loading branch information...
commit f3da9946ffa7392e375186053e1e58f04b5e4452 1 parent 7befed9
TJ Holowaychuk authored June 10, 2012

Showing 1 changed file with 15 additions and 2 deletions. Show diff stats Hide diff stats

  1. 17  test/fresh.js
17  test/fresh.js
@@ -27,7 +27,13 @@ describe('fresh(reqHeader, resHeader)', function(){
27 27
       })
28 28
     })
29 29
 
30  
-    xdescribe('when etag is missing');
  30
+    describe('when etag is missing', function(){
  31
+      it('should be stale', function(){
  32
+        var req = { 'if-none-match': 'tobi' };
  33
+        var res = {};
  34
+        fresh(req, res).should.be.false;
  35
+      })
  36
+    })
31 37
   })
32 38
 
33 39
   describe('when requested with If-Modified-Since', function(){
@@ -49,9 +55,16 @@ describe('fresh(reqHeader, resHeader)', function(){
49 55
       })
50 56
     })
51 57
 
  58
+    describe('when last-modified is missing', function(){
  59
+      it('should be stale', function(){
  60
+        var req = { 'if-none-match': new Date().toUTCString() };
  61
+        var res = {};
  62
+        fresh(req, res).should.be.false;
  63
+      })
  64
+    })
  65
+    
52 66
     xdescribe('with invalid if-modified-since date');
53 67
     xdescribe('with invalid modified-since date');
54  
-    xdescribe('when last-modified is missing');
55 68
   })
56 69
 
57 70
   describe('when requested with If-Modified-Since and If-None-Match', function(){

0 notes on commit f3da994

Please sign in to comment.
Something went wrong with that request. Please try again.