Permalink
Browse files

[minor] Added test for HEAD requests

  • Loading branch information...
1 parent b0b7e33 commit 9c994d5e13cf0383992b7e3005c0d3a13b8be134 @3rd-Eden committed Mar 15, 2013
Showing with 22 additions and 0 deletions.
  1. +22 −0 test/middleware.test.js
View
@@ -169,6 +169,8 @@ describe('version.layer() integration', function () {
});
describe('.layer(pull)', function () {
+ this.timeout(10000);
+
it('should respond with the correct headers', function (done) {
versions.app.request()
.get('/img/trusted.png')
@@ -256,6 +258,26 @@ describe('version.layer() integration', function () {
});
});
+ it('handles HEAD requests', function (done) {
+ versions.app.request()
+ .get('/id:home/img/sprite.png')
+ .end(function (get) {
+ expect(get.statusCode).to.equal(200);
+ expect(get.body).to.not.equal('');
+
+ versions.app.request()
+ .head('/id:home/img/sprite.png')
+ .end(function (head) {
+ expect(head.statusCode).to.equal(200);
+ expect(head.headers['content-length']).to.equal(get.headers['content-length']);
+ expect(head.headers['content-type']).to.equal(get.headers['content-type']);
+ expect(head.body).to.equal('');
+
+ done();
+ });
+ });
+ });
+
it('should cache pull requests in memory');
});

0 comments on commit 9c994d5

Please sign in to comment.