Skip to content

Commit

Permalink
add integrations/get-installations to routes.json
Browse files Browse the repository at this point in the history
  • Loading branch information
ramonsnir authored and kaizensoze committed Oct 4, 2016
1 parent 25d4466 commit 8e7cc81
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 0 deletions.
12 changes: 12 additions & 0 deletions doc/apidoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -1140,6 +1140,18 @@ github.gitdata.updateReference({ ... });
github.installations.create({ ... });
*/

/**
* @api {get} /integration/installations getInstallations
* @apiName getInstallations
* @apiDescription List the integration's installations
* @apiGroup integrations
*
* @apiParam {Number} [page] Page number of the results to fetch.
* @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30.
* @apiExample {js} ex:
github.integrations.getInstallations({ ... });
*/

/**
* @api {post} /repos/:user/:repo/issues/:number/assignees addAssigneesToIssue
* @apiName addAssigneesToIssue
Expand Down
12 changes: 12 additions & 0 deletions lib/routes.json
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,18 @@
}
},

"integrations": {
"get-installations": {
"url": "/integration/installations",
"method": "GET",
"params": {
"$page": null,
"$per_page": null
},
"description": "List the integration's installations"
}
},

"activity": {
"get-events": {
"url": "/events",
Expand Down
41 changes: 41 additions & 0 deletions test/integrationsTest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* Copyright 2012 Cloud9 IDE, Inc.
*
* This product includes software developed by
* Cloud9 IDE, Inc (http://c9.io).
*
* Author: Mike de Boer <info@mikedeboer.nl>
*/

"use strict";

var Assert = require("assert");
var Client = require("./../lib/index");
var testAuth = require("./../testAuth.json");

describe("[integrations]", function() {
var client;
var token = testAuth["token"];

beforeEach(function() {
client = new Client();
client.authenticate({
type: "oauth",
token: token
});
});

it("should successfully execute GET /integration/installations (getInstallations)", function(next) {
client.integrations.getInstallations(
{
page: "Number",
per_page: "Number"
},
function(err, res) {
Assert.equal(err, null);
// other assertions go here
next();
}
);
});
});

0 comments on commit 8e7cc81

Please sign in to comment.