mirror of
https://github.com/ZwareBear/awx.git
synced 2026-05-14 15:58:38 -05:00
Replaced all hard-coded api/v1 references with dynamic references or with v2
This commit is contained in:
@@ -20,7 +20,7 @@ describe('Service: InventoryManageService', () => {
|
||||
spyOn(InventoryManageService, 'error');
|
||||
});
|
||||
it('InventoryManageService.getInventory should handle errors', () => {
|
||||
Rest.expectGET('/api/v1/inventory:id/').respond(400, {});
|
||||
Rest.expectGET('/api/v2/inventory:id/').respond(400, {});
|
||||
Rest.flush();
|
||||
expect(InventoryManageService.error).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
@@ -198,12 +198,12 @@ describe('Controller: jobResultsController', () => {
|
||||
describe('getTowerLinks()', () => {
|
||||
beforeEach(() => {
|
||||
jobData.related = {
|
||||
"created_by": "api/v1/users/12",
|
||||
"inventory": "api/v1/inventories/12",
|
||||
"project": "api/v1/projects/12",
|
||||
"credential": "api/v1/credentials/12",
|
||||
"cloud_credential": "api/v1/credentials/13",
|
||||
"network_credential": "api/v1/credentials/14",
|
||||
"created_by": "api/v2/users/12",
|
||||
"inventory": "api/v2/inventories/12",
|
||||
"project": "api/v2/projects/12",
|
||||
"credential": "api/v2/credentials/12",
|
||||
"cloud_credential": "api/v2/credentials/13",
|
||||
"network_credential": "api/v2/credentials/14",
|
||||
};
|
||||
|
||||
jobData.summary_fields.inventory = {
|
||||
|
||||
@@ -60,8 +60,8 @@ describe('Service: QuerySet', () => {
|
||||
|
||||
|
||||
describe('fn search', () => {
|
||||
let pattern = /\/api\/v1\/inventories\/(.+)\/groups\/*/,
|
||||
endpoint = '/api/v1/inventories/1/groups/',
|
||||
let pattern = /\/api\/v2\/inventories\/(.+)\/groups\/*/,
|
||||
endpoint = '/api/v2/inventories/1/groups/',
|
||||
params = {
|
||||
or__name: 'borg',
|
||||
or__description__icontains: 'assimilate'
|
||||
@@ -72,7 +72,7 @@ describe('Service: QuerySet', () => {
|
||||
.expectGET(pattern)
|
||||
.respond(200, {});
|
||||
QuerySet.search(endpoint, params).then((data) =>{
|
||||
expect(data.config.url).toEqual('/api/v1/inventories/1/groups/?or__name=borg&or__description__icontains=assimilate');
|
||||
expect(data.config.url).toEqual('/api/v2/inventories/1/groups/?or__name=borg&or__description__icontains=assimilate');
|
||||
});
|
||||
$httpBackend.flush();
|
||||
});
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
export default {
|
||||
"id": 109,
|
||||
"type": "workflow_job",
|
||||
"url": "/api/v1/workflow_jobs/109/",
|
||||
"url": "/api/v2/workflow_jobs/109/",
|
||||
"related": {
|
||||
"created_by": "/api/v1/users/1/",
|
||||
"unified_job_template": "/api/v1/workflow_job_templates/27/",
|
||||
"workflow_job_template": "/api/v1/workflow_job_templates/27/",
|
||||
"notifications": "/api/v1/workflow_jobs/109/notifications/",
|
||||
"workflow_nodes": "/api/v1/workflow_jobs/109/workflow_nodes/",
|
||||
"labels": "/api/v1/workflow_jobs/109/labels/",
|
||||
"activity_stream": "/api/v1/workflow_jobs/109/activity_stream/",
|
||||
"relaunch": "/api/v1/workflow_jobs/109/relaunch/",
|
||||
"cancel": "/api/v1/workflow_jobs/109/cancel/"
|
||||
"created_by": "/api/v2/users/1/",
|
||||
"unified_job_template": "/api/v2/workflow_job_templates/27/",
|
||||
"workflow_job_template": "/api/v2/workflow_job_templates/27/",
|
||||
"notifications": "/api/v2/workflow_jobs/109/notifications/",
|
||||
"workflow_nodes": "/api/v2/workflow_jobs/109/workflow_nodes/",
|
||||
"labels": "/api/v2/workflow_jobs/109/labels/",
|
||||
"activity_stream": "/api/v2/workflow_jobs/109/activity_stream/",
|
||||
"relaunch": "/api/v2/workflow_jobs/109/relaunch/",
|
||||
"cancel": "/api/v2/workflow_jobs/109/cancel/"
|
||||
},
|
||||
"summary_fields": {
|
||||
"workflow_job_template": {
|
||||
|
||||
Reference in New Issue
Block a user