shared-code-webhooks

This commit is contained in:
Victor Piousbox
2016-04-04 16:05:07 +00:00
parent d133fc08f2
commit 14b0ec8b03
13 changed files with 305 additions and 20 deletions

View File

@@ -0,0 +1,23 @@
import {
generateUser,
} from '../../../../helpers/api-integration/v3';
let user;
let endpoint = '/user/webhook';
describe('DELETE /user/webhook', () => {
beforeEach(async () => {
user = await generateUser();
});
it('succeeds', async () => {
let id = 'some-id';
user.preferences.webhooks[id] = { url: 'http://some-url.com', enabled: true };
await user.sync();
expect(user.preferences.webhooks).to.eql({});
let response = await user.del(`${endpoint}/${id}`);
expect(response).to.eql({});
await user.sync();
expect(user.preferences.webhooks).to.eql({});
});
});