diff --git a/.travis.yml b/.travis.yml index 1cb77ac..c75db21 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,5 +3,4 @@ node_js: - '0.11' - '0.10' - 0.8 - - 0.6 script: make test-coveralls diff --git a/lib/client.js b/lib/client.js index 4d04cd7..b828d6c 100644 --- a/lib/client.js +++ b/lib/client.js @@ -79,7 +79,7 @@ RESTFulClient.prototype.handleResult = function (err, result, res, callback) { err.statusCode = statusCode; } - callback(null, result); + callback(err, result); }; RESTFulClient.prototype.request = function (method, pathname, data, callback, timeout) { diff --git a/test/client.test.js b/test/client.test.js index 48d49f0..ba8b856 100644 --- a/test/client.test.js +++ b/test/client.test.js @@ -15,7 +15,7 @@ var should = require('should'); describe('client.test.js', function () { - var gitlab = new Gitlab({token: 'enEWf516mA168tP6BiVe', requestTimeout: 9000}); + var gitlab = new Gitlab({token: 'xD2u7qqskGczXKZ7Mum9', requestTimeout: 9000}); describe('RESTfulClient', function () { describe('request()', function () { @@ -56,14 +56,14 @@ describe('client.test.js', function () { describe('get()', function () { it('should get a project', function (done) { - gitlab.projects.get({id: 2298}, function (err, result) { + gitlab.projects.get({id: 1}, function (err, result) { should.not.exists(err); should.exists(result); - result.name.should.equal('fawave'); - result.id.should.equal(2298); - result.path_with_namespace.should.equal('fengmk2/fawave'); - result.created_at.should.equal('2013-02-06T02:40:48Z'); - console.log(new Date(result.created_at)); + result.name.should.equal('Diaspora'); + result.id.should.equal(1); + result.path_with_namespace.should.equal('diaspora/diaspora'); + result.created_at.should.equal('2012-12-21T12:57:47Z'); + new Date(result.created_at).should.be.instanceof(Date); done(); }); }); diff --git a/test/gitlab_client.js b/test/gitlab_client.js index 4e8949c..d166698 100644 --- a/test/gitlab_client.js +++ b/test/gitlab_client.js @@ -20,7 +20,7 @@ util.inherits(Project, restful.RESTFulResource); function Gitlab(options) { options = options || {}; - options.api = options.api || 'https://gitlab.com/api/v3'; + options.api = options.api || 'http://demo.gitlab.com/api/v3'; this.constructor.super_.call(this, options); this.token = options.token;