From c60aee9d66d342946072b4ef2db191cd8e09bc4e Mon Sep 17 00:00:00 2001 From: DallonF Date: Mon, 20 Aug 2012 10:03:11 -0700 Subject: [PATCH] Added test case for rare crash --- lib/resources/user-collection.js | 1 - test-app/public/test/user-collection.test.js | 7 +++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/resources/user-collection.js b/lib/resources/user-collection.js index a72cbcc..9c6c3ea 100644 --- a/lib/resources/user-collection.js +++ b/lib/resources/user-collection.js @@ -118,7 +118,6 @@ UserCollection.prototype.handle = function (ctx) { ctx.done(err, res); } - console.log(ctx.query); if(ctx.query.id || ctx.body.id) { this.save(ctx, done); } else { diff --git a/test-app/public/test/user-collection.test.js b/test-app/public/test/user-collection.test.js index b709ba7..74bb9de 100644 --- a/test-app/public/test/user-collection.test.js +++ b/test-app/public/test/user-collection.test.js @@ -70,6 +70,13 @@ describe('User Collection', function() { }) }) }) + + it('should not crash the server when called without a body', function(done) { + dpd.users.login(null, function(session, err) { + expect(err).to.exist; + done(); + }); + }); }) describe('.me(fn)', function() { it('should return the current user', function(done) {