Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added res.send(Object) test

  • Loading branch information...
commit d0d721d80b99c4679575b3ed74fd435d36e80798 1 parent 7b50a78
@tj tj authored
Showing with 18 additions and 0 deletions.
  1. +18 −0 test/res.send.js
View
18 test/res.send.js
@@ -144,4 +144,22 @@ describe('res', function(){
})
})
})
+
+ describe('.send(Object)', function(){
+ it('should send as application/json', function(done){
+ var app = express();
+
+ app.use(function(req, res){
+ res.send({ name: 'tobi' });
+ });
+
+ request(app)
+ .get('/')
+ .end(function(res){
+ res.headers.should.have.property('content-type', 'application/json; charset=utf-8');
+ res.body.should.equal('{"name":"tobi"}');
+ done();
+ })
+ })
+ })
})
Please sign in to comment.
Something went wrong with that request. Please try again.