Skip to content

Commit c5d7207

Browse files
committed
add extra test for updating settings
1 parent 25e5ff4 commit c5d7207

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

test/settings/patch/index.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,29 @@ describe('PATCH /settings/:id', {timeout:500}, function () {
9393
});
9494
});
9595

96+
it('should be possible to remove setting', function (done) {
97+
var newSettings = {
98+
notifications: {
99+
slack: {
100+
webhookUrl: ''
101+
},
102+
hipchat: {
103+
authToken: 'new-hipchat-token',
104+
roomId: 1231231
105+
}
106+
}
107+
};
108+
ctx.user.newSetting(settingsId).update({json: newSettings}, function (err, body) {
109+
if (err) { return done(err); }
110+
expect(body._id).to.exist();
111+
expect(body.owner.github).to.equal(settings.owner.github);
112+
expect(body.notifications.slack.webhookUrl).to.equal(newSettings.notifications.slack.webhookUrl);
113+
expect(body.notifications.hipchat.authToken).to.equal(newSettings.notifications.hipchat.authToken);
114+
expect(body.notifications.hipchat.roomId).to.equal(newSettings.notifications.hipchat.roomId);
115+
done();
116+
});
117+
});
118+
96119

97120
it('should not be possible to update setting using the wrong user', function (done) {
98121
require('../../fixtures/mocks/github/user-orgs')(ctx.user);

0 commit comments

Comments
 (0)