Adding edit of incoming webhook (#5272)

Adding edit of outgoing webhook
Fixing spelling of error
Fixing style
Changing from PUT to POST for updates
Fixing test failures due to merge
Этот коммит содержится в:
Poornima
2017-02-27 00:18:20 +05:30
коммит произвёл Joram Wilander
родитель c0bb6f99f8
Коммит 19b753467d
35 изменённых файлов: 1939 добавлений и 763 удалений

Просмотреть файл

@@ -22,7 +22,29 @@ describe('Client.Hooks', function() {
done(new Error('hooks not enabled'));
},
function(err) {
assert.equal(err.id, 'api.webhook.create_incoming.disabled.app_errror');
assert.equal(err.id, 'api.webhook.create_incoming.disabled.app_error');
done();
}
);
});
});
it('updateIncomingHook', function(done) {
TestHelper.initBasic(() => {
TestHelper.basicClient().enableLogErrorsToConsole(false); // Disabling since this unit test causes an error
var hook = {};
hook.channel_id = TestHelper.basicChannel().id;
hook.description = 'desc';
hook.display_name = 'Unit Test';
TestHelper.basicClient().updateIncomingHook(
hook,
function() {
done(new Error('hooks not enabled'));
},
function(err) {
assert.equal(err.id, 'api.webhook.update_incoming.disabled.app_error');
done();
}
);
@@ -38,7 +60,7 @@ describe('Client.Hooks', function() {
done(new Error('hooks not enabled'));
},
function(err) {
assert.equal(err.id, 'api.webhook.delete_incoming.disabled.app_errror');
assert.equal(err.id, 'api.webhook.delete_incoming.disabled.app_error');
done();
}
);
@@ -128,5 +150,27 @@ describe('Client.Hooks', function() {
);
});
});
it('updateOutgoingHook', function(done) {
TestHelper.initBasic(() => {
TestHelper.basicClient().enableLogErrorsToConsole(false); // Disabling since this unit test causes an error
var hook = {};
hook.channel_id = TestHelper.basicChannel().id;
hook.description = 'desc';
hook.display_name = 'Unit Test';
TestHelper.basicClient().updateOutgoingHook(
hook,
function() {
done(new Error('hooks not enabled'));
},
function(err) {
assert.equal(err.id, 'api.webhook.update_outgoing.disabled.app_error');
done();
}
);
});
});
});