revamp db - refactor webhooks

This commit is contained in:
Dave Horton
2020-01-28 10:30:07 -05:00
parent 10074504c5
commit 87208bc669
13 changed files with 675 additions and 252 deletions
+20 -9
View File
@@ -55,7 +55,10 @@ test('authentication tests', async(t) => {
simple: false,
json: true,
body: {
name: 'accountA1'
name: 'accountA1',
registration_hook: {
url: 'http://example.com'
}
}
});
t.ok(result.statusCode === 201, 'successfully created account A1 using service provider token A');
@@ -216,8 +219,12 @@ test('authentication tests', async(t) => {
json: true,
body: {
name: 'A1-app',
call_hook: 'http://example.com',
call_status_hook: 'http://example.com'
call_hook: {
url: 'http://example.com'
},
call_status_hook: {
url: 'http://example.com'
}
}
});
t.ok(result.statusCode === 201, 'successfully created application for account A1 (using account level token)');
@@ -231,8 +238,12 @@ test('authentication tests', async(t) => {
body: {
name: 'A2-app',
account_sid: accA2,
call_hook: 'http://example.com',
call_status_hook: 'http://example.com'
call_hook: {
url: 'http://example.com',
},
call_status_hook: {
url: 'http://example.com'
}
}
});
t.ok(result.statusCode === 400 && result.body.msg === 'insufficient privileges to create an application under the specified account',
@@ -246,8 +257,8 @@ test('authentication tests', async(t) => {
body: {
name: 'A2-app',
account_sid: accA2,
call_hook: 'http://example.com',
call_status_hook: 'http://example.com'
call_hook: {url: 'http://example.com'},
call_status_hook: {url: 'http://example.com'}
}
});
t.ok(result.statusCode === 201, 'successfully created application for account A2 (using service provider token A)');
@@ -261,8 +272,8 @@ test('authentication tests', async(t) => {
body: {
name: 'B1-app',
account_sid: accB1,
call_hook: 'http://example.com',
call_status_hook: 'http://example.com'
call_hook: {url: 'http://example.com'},
call_status_hook: {url: 'http://example.com'}
}
});
t.ok(result.statusCode === 201, 'successfully created application for account B1 (using service provider token B)');