diff --git a/test/application.js b/test/application.js index 3915d1a..bf93c25 100644 --- a/test/application.js +++ b/test/application.js @@ -61,6 +61,34 @@ describe('app.respond', function(){ done(); }); }) + + it('should respond with a 404 if no body was set', function(done){ + var app = koa(); + + app.use(function *(){ + this.status = 200; + }) + + var server = app.listen(); + + request(server) + .head('/') + .expect(404, done); + }) + + it('should respond with a 200 if body = ""', function(done){ + var app = koa(); + + app.use(function *(){ + this.body = ''; + }) + + var server = app.listen(); + + request(server) + .head('/') + .expect(200, done); + }) }) describe('when no middleware are present', function(){