diff --git a/README.md b/README.md index e2914290..aad17fea 100644 --- a/README.md +++ b/README.md @@ -243,6 +243,12 @@ List organizations the autenticated user belongs to. user.orgs(function(err, orgs) {}); ``` +List organization members by organization ID + +```js +user.orgMembers(orgId); +``` + List authenticated user's gists. ```js diff --git a/github.js b/github.js index 2e0d3591..21c9e98b 100644 --- a/github.js +++ b/github.js @@ -178,6 +178,12 @@ this.orgs = function(cb) { _request('GET', '/user/orgs', null, cb); }; + + // List members of given organization + // ------- + this.orgMembers = function (orgId, cb) { + _request('GET', '/organizations/' + orgId + '/members', options, cb); + }; // List authenticated user's gists // ------- diff --git a/test/test.user.js b/test/test.user.js index c4d3d77e..8efd12e2 100644 --- a/test/test.user.js +++ b/test/test.user.js @@ -54,6 +54,13 @@ describe('Github.User', function() { }); }); + it('should get user.orgMembers from "dolores" company', function(done) { + user.orgMembers(testUser.ORGID, function(err) { + should.not.exist(err); + done(); + }); + }); + it('should get user.gists', function(done) { user.gists(function(err) { should.not.exist(err); diff --git a/test/user.json b/test/user.json index 2c57a9ed..dc362337 100644 --- a/test/user.json +++ b/test/user.json @@ -1 +1,6 @@ -{"USERNAME": "mikedeboertest", "PASSWORD": "test1324", "REPO": "github"} +{ + "USERNAME": "mikedeboertest", + "PASSWORD": "test1324", + "REPO": "github", + "ORGID": "12733" +}