Skip to content

Commit ef54b6f

Browse files
committed
Merge 66cf345 into 2644222
2 parents 2644222 + 66cf345 commit ef54b6f

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

lib/resources/project.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,11 @@ util.inherits(Project, restful.RESTFulResource);
3434
* @param {Function(err, project)} callback
3535
*/
3636
Project.prototype.getByPath = function (params, callback) {
37-
this.client.request('get', '/project', params, callback);
37+
this.client.request('get', '/projects', params, function (err, projects) {
38+
if (err) {
39+
callback(err);
40+
}
41+
42+
callback(null, projects[0]);
43+
});
3844
};

test/project.test.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,19 @@ describe('project.test.js', function () {
5656

5757
});
5858

59-
describe.skip('client.projects.getByPath()', function () {
59+
describe('client.projects.getByPath()', function () {
6060
it('should return a project by path', function (done) {
6161
client.projects.getByPath({path: 'fengmk2/node-gitlab-test'}, function (err, project) {
6262
should.not.exists(err);
63-
project.id.should.equal(1040);
64-
// project.should.have.keys('created_at', 'default_branch', 'description', 'id',
65-
// 'issues_enabled', 'merge_requests_enabled', 'name', 'namespace_id',
66-
// 'creator_id', 'snippets_enabled', 'public',
67-
// 'issues_tracker_id', 'issues_tracker', 'last_activity_at',
68-
// 'path', 'private_flag', 'updated_at', 'wall_enabled', 'wiki_enabled');
63+
project.path_with_namespace.should.equal('fengmk2/gitlab');
64+
project.should.have.keys('id', 'name', 'description', 'default_branch',
65+
'owner',
66+
'ssh_url_to_repo', 'http_url_to_repo',
67+
'web_url',
68+
'public', 'path', 'path_with_namespace', 'name_with_namespace', 'namespace',
69+
'issues_enabled', 'merge_requests_enabled',
70+
'wiki_enabled', 'created_at', 'last_activity_at',
71+
'archived', 'visibility_level', 'snippets_enabled');
6972
done();
7073
});
7174
});

0 commit comments

Comments
 (0)