mirror of
https://github.com/jambonz/jambonz-api-server.git
synced 2025-12-19 05:47:46 +00:00
feat/367 added support for name query parameter for retrieving application (#368)
* feat/367 added support for name query parameter for getting application by name * feat/367 - Updated test case and modified retrieveAll method to make name independent of service_provider_id and account_sid * updated query to use WHERE 1=1 to avoid whereFlag variable * feat/367: removed empty line added accidently
This commit is contained in:
@@ -121,6 +121,25 @@ test('application tests', async(t) => {
|
||||
let app_json = JSON.parse(result.app_json);
|
||||
t.ok(app_json[0].verb === 'play', 'successfully retrieved app_json from application')
|
||||
|
||||
/* query one application by name*/
|
||||
result = await request.get(`/Applications`, {
|
||||
qs : {
|
||||
name: 'daveh'
|
||||
},
|
||||
auth: authAdmin,
|
||||
json: true,
|
||||
});
|
||||
t.ok(result.length === 1 && result[0].name === 'daveh', 'successfully queried application by name');
|
||||
|
||||
/* query application with invalid name*/
|
||||
result = await request.get(`/Applications`, {
|
||||
qs : {
|
||||
name: 'daveh-invalid'
|
||||
},
|
||||
auth: authAdmin,
|
||||
json: true,
|
||||
});
|
||||
t.ok(result.length === 0, 'successfully queried application by invalid name, no results found');
|
||||
|
||||
/* update applications */
|
||||
result = await request.put(`/Applications/${sid}`, {
|
||||
|
||||
Reference in New Issue
Block a user