forked from mirrors/probot
Fix tests and use helper
This commit is contained in:
parent
02f84685f4
commit
80deaebe15
|
@ -11,10 +11,7 @@
|
|||
//
|
||||
|
||||
module.exports = function (github, payload, logins) {
|
||||
return github.issues.removeAssigneesFromIssue({
|
||||
owner: payload.repository.owner.login,
|
||||
repo: payload.repository.name,
|
||||
number: payload.issue.number,
|
||||
body: {assignees: [].concat(logins)}
|
||||
});
|
||||
return github.issues.removeAssigneesFromIssue(
|
||||
payload.toIssue({body: {assignees: [].concat(logins)}})
|
||||
);
|
||||
};
|
||||
|
|
|
@ -14,7 +14,8 @@
|
|||
"github": "^5.0.1",
|
||||
"github-webhook-handler": "^0.6.0",
|
||||
"handlebars": "^4.0.5",
|
||||
"js-yaml": "^3.6.1"
|
||||
"js-yaml": "^3.6.1",
|
||||
"jsdoc": "^3.4.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"mocha": "^3.0.2",
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
const expect = require('expect');
|
||||
const action = require('../../lib/actions/unassign');
|
||||
const payload = require('../fixtures/webhook/comment.created.json');
|
||||
const Payload = require('../../lib/payload');
|
||||
const payload = new Payload(require('../fixtures/webhook/comment.created.json'));
|
||||
|
||||
const createSpy = expect.createSpy;
|
||||
|
||||
|
@ -17,7 +18,7 @@ describe('action.unassign', () => {
|
|||
owner: 'bkeepers-inc',
|
||||
repo: 'test',
|
||||
number: 6,
|
||||
body: ['bkeepers']
|
||||
body: {assignees: ['bkeepers']}
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -27,7 +28,7 @@ describe('action.unassign', () => {
|
|||
owner: 'bkeepers-inc',
|
||||
repo: 'test',
|
||||
number: 6,
|
||||
body: ['hello', 'world']
|
||||
body: {assignees: ['hello', 'world']}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue