From 62e5d2b73ca531e0d69ca067a45202594bd9c28f Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Wed, 19 Mar 2014 17:44:38 +0100 Subject: [PATCH] Give more detail on test failure --- test/acceptance/app.auth.test.js | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/test/acceptance/app.auth.test.js b/test/acceptance/app.auth.test.js index 644fd29b..c69ba504 100644 --- a/test/acceptance/app.auth.test.js +++ b/test/acceptance/app.auth.test.js @@ -27,9 +27,10 @@ test('invalid api key should NOT allow insert in protected tables', function(don headers: {host: 'vizzuality.cartodb.com' }, method: 'GET' - },{ - status: 400 - }, function() { done(); }); + },{}, function(res) { + assert.equal(res.statusCode, 400, res.statusCode + ': ' + res.body); + done(); + }); }); test('invalid api key (old redis location) should NOT allow insert in protected tables', function(done){ @@ -39,9 +40,10 @@ test('invalid api key (old redis location) should NOT allow insert in protected headers: {host: 'vizzuality.cartodb.com' }, method: 'GET' - },{ - status: 400 - }, function() { done(); }); + },{}, function(res) { + assert.equal(res.statusCode, 400, res.statusCode + ': ' + res.body); + done(); + }); }); test('no api key should NOT allow insert in protected tables', function(done){ @@ -51,9 +53,10 @@ test('no api key should NOT allow insert in protected tables', function(done){ headers: {host: 'vizzuality.cartodb.com' }, method: 'GET' - },{ - status: 400 - }, function() { done(); }); + },{}, function(res) { + assert.equal(res.statusCode, 400, res.statusCode + ': ' + res.body); + done(); + }); }); test('no api key should NOT allow insert in public tables', function(done){ @@ -63,9 +66,10 @@ test('no api key should NOT allow insert in public tables', function(done){ headers: {host: 'vizzuality.cartodb.com' }, method: 'GET' - },{ - status: 400 - }, function() { done(); }); + },{}, function(res) { + assert.equal(res.statusCode, 400, res.statusCode + ': ' + res.body); + done(); + }); }); });