Created
May 1, 2017 06:14
-
-
Save mootrichard/1855144537c862617398668c58e10bc3 to your computer and use it in GitHub Desktop.
Rest API Planning Test Collection
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"variables": [], | |
"info": { | |
"name": "Rest API Planning", | |
"_postman_id": "4b9b4065-d319-6f32-bae2-2dd4e0f33d0d", | |
"description": "", | |
"schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json" | |
}, | |
"item": [ | |
{ | |
"name": "Boats", | |
"description": "", | |
"item": [ | |
{ | |
"name": "Create a boat", | |
"event": [ | |
{ | |
"listen": "test", | |
"script": { | |
"type": "text/javascript", | |
"exec": [ | |
"json_response = JSON.parse(responseBody)", | |
"postman.setEnvironmentVariable(\"boat_id\", json_response.id);", | |
"", | |
"tests[\"Status code is 200\"] = responseCode.code === 200;", | |
"tests[\"Boat is at sea\"] = json_response.at_sea === true;" | |
] | |
} | |
} | |
], | |
"request": { | |
"url": "{{url}}/boat", | |
"method": "POST", | |
"header": [ | |
{ | |
"key": "Content-Type", | |
"value": "application/json", | |
"description": "" | |
} | |
], | |
"body": { | |
"mode": "raw", | |
"raw": "{\n\t\"name\": \"Sea Witch\",\n\t\"type\":\"Sailboat\",\n\t\"length\":28,\n\t\"at_sea\":false\n}" | |
}, | |
"description": "" | |
}, | |
"response": [] | |
}, | |
{ | |
"name": "List boats", | |
"event": [ | |
{ | |
"listen": "test", | |
"script": { | |
"type": "text/javascript", | |
"exec": [ | |
"json_response = JSON.parse(responseBody)", | |
"foundId = false", | |
"", | |
"json_response.forEach(function(elem){", | |
" if(elem.id == environment.boat_id){", | |
" foundId = true;", | |
" }", | |
"});", | |
"", | |
"tests[\"List of boats is not empty\"] = json_response.length > 0;", | |
"tests[\"List of boats contains created boat\"] = foundId;" | |
] | |
} | |
} | |
], | |
"request": { | |
"url": "{{url}}/boat", | |
"method": "GET", | |
"header": [ | |
{ | |
"key": "Content-Type", | |
"value": "application/json", | |
"description": "" | |
} | |
], | |
"body": { | |
"mode": "raw", | |
"raw": "{\n\t\"name\": \"Sea Witch\",\n\t\"type\":\"Sailboat\",\n\t\"length\":28,\n\t\"at_sea\":false\n}" | |
}, | |
"description": "" | |
}, | |
"response": [] | |
}, | |
{ | |
"name": "Get a boat", | |
"event": [ | |
{ | |
"listen": "test", | |
"script": { | |
"type": "text/javascript", | |
"exec": [ | |
"json_response = JSON.parse(responseBody)", | |
"", | |
"tests[\"Status code is 200\"] = responseCode.code === 200;", | |
"tests[\"Name still Sea Witch\"] = json_response.name === \"Sea Witch\"", | |
"tests[\"Key matches created boat\"] = json_response.id === environment.boat_id" | |
] | |
} | |
} | |
], | |
"request": { | |
"url": "{{url}}/boat/{{boat_id}}", | |
"method": "GET", | |
"header": [ | |
{ | |
"key": "Content-Type", | |
"value": "application/json", | |
"description": "" | |
} | |
], | |
"body": { | |
"mode": "raw", | |
"raw": "{\n\t\"name\": \"Sea Witch\",\n\t\"type\":\"Sailboat\",\n\t\"length\":28,\n\t\"at_sea\":false\n}" | |
}, | |
"description": "" | |
}, | |
"response": [] | |
}, | |
{ | |
"name": "Update a boat", | |
"event": [ | |
{ | |
"listen": "test", | |
"script": { | |
"type": "text/javascript", | |
"exec": [ | |
"json_response = JSON.parse(responseBody)", | |
"", | |
"tests[\"Status code is 200\"] = responseCode.code === 200;", | |
"tests[\"Name updated to Ricahrd\"] = json_response.type === \"Richard\"", | |
"tests[\"Name still Sea Witch\"] = json_response.name === \"Sea Witch\"" | |
] | |
} | |
} | |
], | |
"request": { | |
"url": "{{url}}/boat/{{boat_id}}", | |
"method": "PATCH", | |
"header": [ | |
{ | |
"key": "Content-Type", | |
"value": "application/json", | |
"description": "" | |
} | |
], | |
"body": { | |
"mode": "raw", | |
"raw": "{\n\t\"type\":\"Richard\",\n\t\"length\":28,\n\t\"at_sea\":false\n}" | |
}, | |
"description": "" | |
}, | |
"response": [] | |
}, | |
{ | |
"name": "Delete a boat", | |
"event": [ | |
{ | |
"listen": "test", | |
"script": { | |
"type": "text/javascript", | |
"exec": [ | |
"tests[\"Status code is 200\"] = responseCode.code === 204;" | |
] | |
} | |
} | |
], | |
"request": { | |
"url": "{{url}}/boat/{{boat_id}}", | |
"method": "DELETE", | |
"header": [ | |
{ | |
"key": "Content-Type", | |
"value": "application/json", | |
"description": "" | |
} | |
], | |
"body": { | |
"mode": "raw", | |
"raw": "" | |
}, | |
"description": "" | |
}, | |
"response": [] | |
} | |
] | |
}, | |
{ | |
"name": "Slips", | |
"description": "", | |
"item": [ | |
{ | |
"name": "Create slip", | |
"event": [ | |
{ | |
"listen": "test", | |
"script": { | |
"type": "text/javascript", | |
"exec": [ | |
"json_response = JSON.parse(responseBody)", | |
"", | |
"postman.setEnvironmentVariable(\"slip_id\", json_response.id);", | |
"", | |
"tests[\"Status code is 200\"] = responseCode.code === 200;", | |
"tests[\"Data is returned back\"] = json_response.number === parseInt(environment.next_slip_number);" | |
] | |
} | |
}, | |
{ | |
"listen": "prerequest", | |
"script": { | |
"type": "text/javascript", | |
"exec": [ | |
"if(environment.next_slip_number === \"\"){", | |
" postman.setEnvironmentVariable(\"next_slip_number\", 1);", | |
"}" | |
] | |
} | |
} | |
], | |
"request": { | |
"url": "{{url}}/slip/", | |
"method": "POST", | |
"header": [ | |
{ | |
"key": "Content-Type", | |
"value": "application/json", | |
"description": "" | |
} | |
], | |
"body": { | |
"mode": "raw", | |
"raw": "{\n\t\"number\": {{next_slip_number}}\n}" | |
}, | |
"description": "" | |
}, | |
"response": [] | |
}, | |
{ | |
"name": "List slips", | |
"event": [ | |
{ | |
"listen": "test", | |
"script": { | |
"type": "text/javascript", | |
"exec": [ | |
"json_response = JSON.parse(responseBody);", | |
"foundId = false;", | |
"", | |
"json_response.forEach(function(elem){", | |
" if(elem.id == environment.slip_id){", | |
" foundId = true;", | |
" }", | |
"});", | |
"", | |
"tests[\"Status code is 200\"] = responseCode.code === 200;", | |
"tests[\"List contains create slip\"] = foundId;", | |
"", | |
"postman.setEnvironmentVariable(\"next_slip_number\", parseInt(json_response[json_response.length-1].number) + 1);" | |
] | |
} | |
} | |
], | |
"request": { | |
"url": "{{url}}/slip", | |
"method": "GET", | |
"header": [], | |
"body": {}, | |
"description": "" | |
}, | |
"response": [] | |
}, | |
{ | |
"name": "Get a slip", | |
"event": [ | |
{ | |
"listen": "test", | |
"script": { | |
"type": "text/javascript", | |
"exec": [ | |
"json_response = JSON.parse(responseBody)", | |
"", | |
"tests[\"Status code is 200\"] = responseCode.code === 200;", | |
"tests[\"Id matches created slip\"] = json_response.id.toString() === environment.slip_id.toString();" | |
] | |
} | |
} | |
], | |
"request": { | |
"url": "{{url}}/slip/{{slip_id}}", | |
"method": "GET", | |
"header": [], | |
"body": {}, | |
"description": "" | |
}, | |
"response": [] | |
}, | |
{ | |
"name": "Update a slip", | |
"event": [ | |
{ | |
"listen": "test", | |
"script": { | |
"type": "text/javascript", | |
"exec": [ | |
"json_response = JSON.parse(responseBody)", | |
"", | |
"tests[\"Status code is 200\"] = responseCode.code === 200;", | |
"tests[\"Slip number is updated\"] = json_response.number === parseInt(environment.next_slip_number);", | |
"", | |
"if (json_response.number){", | |
" postman.setEnvironmentVariable(\"next_slip_number\", parseInt(json_response.number) + 1);", | |
"}" | |
] | |
} | |
} | |
], | |
"request": { | |
"url": "{{url}}/slip/{{slip_id}}", | |
"method": "PATCH", | |
"header": [ | |
{ | |
"key": "Content-Type", | |
"value": "application/json", | |
"description": "" | |
} | |
], | |
"body": { | |
"mode": "raw", | |
"raw": "{\n\t\"number\": {{next_slip_number}}\n}" | |
}, | |
"description": "" | |
}, | |
"response": [] | |
}, | |
{ | |
"name": "Boat arrival to slip", | |
"event": [ | |
{ | |
"listen": "test", | |
"script": { | |
"type": "text/javascript", | |
"exec": [ | |
"json_response = JSON.parse(responseBody)", | |
"", | |
"tests[\"Status code is 200\"] = responseCode.code === 200;", | |
"tests[\"Slip contains a boat\"] = json_response.current_boat !== null;", | |
"tests[\"Arrival date is not null\"] = json_response.arrival_date !== null;" | |
] | |
} | |
} | |
], | |
"request": { | |
"url": "{{url}}/slip/{{slip_id}}/boat", | |
"method": "POST", | |
"header": [ | |
{ | |
"key": "Content-Type", | |
"value": "application/json", | |
"description": "" | |
} | |
], | |
"body": { | |
"mode": "raw", | |
"raw": "{\n\t\"boat_id\": \"{{boat_id}}\"\n}" | |
}, | |
"description": "" | |
}, | |
"response": [] | |
}, | |
{ | |
"name": "Boat departure from slip", | |
"event": [ | |
{ | |
"listen": "test", | |
"script": { | |
"type": "text/javascript", | |
"exec": [ | |
"tests[\"Status code is 200\"] = responseCode.code === 204;" | |
] | |
} | |
} | |
], | |
"request": { | |
"url": "{{url}}/slip/{{slip_id}}/boat", | |
"method": "DELETE", | |
"header": [ | |
{ | |
"key": "Content-Type", | |
"value": "application/json", | |
"description": "" | |
} | |
], | |
"body": { | |
"mode": "raw", | |
"raw": "" | |
}, | |
"description": "" | |
}, | |
"response": [] | |
}, | |
{ | |
"name": "Delete a slip", | |
"event": [ | |
{ | |
"listen": "test", | |
"script": { | |
"type": "text/javascript", | |
"exec": [ | |
"tests[\"Status code is 200\"] = responseCode.code === 204;", | |
"" | |
] | |
} | |
} | |
], | |
"request": { | |
"url": "{{url}}/slip/{{slip_id}}", | |
"method": "DELETE", | |
"header": [], | |
"body": {}, | |
"description": "" | |
}, | |
"response": [] | |
} | |
] | |
}, | |
{ | |
"name": "Test Collection", | |
"description": "", | |
"item": [ | |
{ | |
"name": "Create a boat copy", | |
"event": [ | |
{ | |
"listen": "test", | |
"script": { | |
"type": "text/javascript", | |
"exec": [ | |
"json_response = JSON.parse(responseBody)", | |
"postman.setEnvironmentVariable(\"boat_id\", json_response.id);", | |
"", | |
"tests[\"Status code is 200\"] = responseCode.code === 200;", | |
"tests[\"Boat is at sea\"] = json_response.at_sea === true;" | |
] | |
} | |
} | |
], | |
"request": { | |
"url": "{{url}}/boat", | |
"method": "POST", | |
"header": [ | |
{ | |
"key": "Content-Type", | |
"value": "application/json", | |
"description": "" | |
} | |
], | |
"body": { | |
"mode": "raw", | |
"raw": "{\n\t\"name\": \"Sea Witch\",\n\t\"type\":\"Sailboat\",\n\t\"length\":28,\n\t\"at_sea\":false\n}" | |
}, | |
"description": "" | |
}, | |
"response": [] | |
}, | |
{ | |
"name": "List boats copy", | |
"event": [ | |
{ | |
"listen": "test", | |
"script": { | |
"type": "text/javascript", | |
"exec": [ | |
"json_response = JSON.parse(responseBody)", | |
"foundId = false", | |
"", | |
"json_response.forEach(function(elem){", | |
" if(elem.id == environment.boat_id){", | |
" foundId = true;", | |
" }", | |
"});", | |
"", | |
"tests[\"List of boats is not empty\"] = json_response.length > 0;", | |
"tests[\"List of boats contains created boat\"] = foundId;" | |
] | |
} | |
} | |
], | |
"request": { | |
"url": "{{url}}/boat", | |
"method": "GET", | |
"header": [ | |
{ | |
"key": "Content-Type", | |
"value": "application/json", | |
"description": "" | |
} | |
], | |
"body": { | |
"mode": "raw", | |
"raw": "{\n\t\"name\": \"Sea Witch\",\n\t\"type\":\"Sailboat\",\n\t\"length\":28,\n\t\"at_sea\":false\n}" | |
}, | |
"description": "" | |
}, | |
"response": [] | |
}, | |
{ | |
"name": "Get a boat copy", | |
"event": [ | |
{ | |
"listen": "test", | |
"script": { | |
"type": "text/javascript", | |
"exec": [ | |
"json_response = JSON.parse(responseBody)", | |
"", | |
"tests[\"Status code is 200\"] = responseCode.code === 200;", | |
"tests[\"Name still Sea Witch\"] = json_response.name === \"Sea Witch\"", | |
"tests[\"Key matches created boat\"] = json_response.id === environment.boat_id" | |
] | |
} | |
} | |
], | |
"request": { | |
"url": "{{url}}/boat/{{boat_id}}", | |
"method": "GET", | |
"header": [ | |
{ | |
"key": "Content-Type", | |
"value": "application/json", | |
"description": "" | |
} | |
], | |
"body": { | |
"mode": "raw", | |
"raw": "{\n\t\"name\": \"Sea Witch\",\n\t\"type\":\"Sailboat\",\n\t\"length\":28,\n\t\"at_sea\":false\n}" | |
}, | |
"description": "" | |
}, | |
"response": [] | |
}, | |
{ | |
"name": "Update a boat copy", | |
"event": [ | |
{ | |
"listen": "test", | |
"script": { | |
"type": "text/javascript", | |
"exec": [ | |
"json_response = JSON.parse(responseBody)", | |
"", | |
"tests[\"Status code is 200\"] = responseCode.code === 200;", | |
"tests[\"Name updated to Ricahrd\"] = json_response.type === \"Richard\"", | |
"tests[\"Name still Sea Witch\"] = json_response.name === \"Sea Witch\"" | |
] | |
} | |
} | |
], | |
"request": { | |
"url": "{{url}}/boat/{{boat_id}}", | |
"method": "PATCH", | |
"header": [ | |
{ | |
"key": "Content-Type", | |
"value": "application/json", | |
"description": "" | |
} | |
], | |
"body": { | |
"mode": "raw", | |
"raw": "{\n\t\"type\":\"Richard\",\n\t\"length\":28,\n\t\"at_sea\":false\n}" | |
}, | |
"description": "" | |
}, | |
"response": [] | |
}, | |
{ | |
"name": "Delete a boat copy", | |
"event": [ | |
{ | |
"listen": "test", | |
"script": { | |
"type": "text/javascript", | |
"exec": [ | |
"tests[\"Status code is 200\"] = responseCode.code === 204;" | |
] | |
} | |
} | |
], | |
"request": { | |
"url": "{{url}}/boat/{{boat_id}}", | |
"method": "DELETE", | |
"header": [ | |
{ | |
"key": "Content-Type", | |
"value": "application/json", | |
"description": "" | |
} | |
], | |
"body": { | |
"mode": "raw", | |
"raw": "" | |
}, | |
"description": "" | |
}, | |
"response": [] | |
}, | |
{ | |
"name": "Create a boat copy", | |
"event": [ | |
{ | |
"listen": "test", | |
"script": { | |
"type": "text/javascript", | |
"exec": [ | |
"json_response = JSON.parse(responseBody)", | |
"postman.setEnvironmentVariable(\"boat_id\", json_response.id);", | |
"", | |
"tests[\"Status code is 200\"] = responseCode.code === 200;", | |
"tests[\"Boat is at sea\"] = json_response.at_sea === true;" | |
] | |
} | |
} | |
], | |
"request": { | |
"url": "{{url}}/boat", | |
"method": "POST", | |
"header": [ | |
{ | |
"key": "Content-Type", | |
"value": "application/json", | |
"description": "" | |
} | |
], | |
"body": { | |
"mode": "raw", | |
"raw": "{\n\t\"name\": \"Sea Witch\",\n\t\"type\":\"Sailboat\",\n\t\"length\":28,\n\t\"at_sea\":false\n}" | |
}, | |
"description": "" | |
}, | |
"response": [] | |
}, | |
{ | |
"name": "Create slip copy", | |
"event": [ | |
{ | |
"listen": "test", | |
"script": { | |
"type": "text/javascript", | |
"exec": [ | |
"json_response = JSON.parse(responseBody)", | |
"", | |
"postman.setEnvironmentVariable(\"slip_id\", json_response.id);", | |
"", | |
"tests[\"Status code is 200\"] = responseCode.code === 200;", | |
"tests[\"Data is returned back\"] = json_response.number === parseInt(environment.next_slip_number);" | |
] | |
} | |
}, | |
{ | |
"listen": "prerequest", | |
"script": { | |
"type": "text/javascript", | |
"exec": [ | |
"if(environment.next_slip_number === \"\"){", | |
" postman.setEnvironmentVariable(\"next_slip_number\", 1);", | |
"}" | |
] | |
} | |
} | |
], | |
"request": { | |
"url": "{{url}}/slip/", | |
"method": "POST", | |
"header": [ | |
{ | |
"key": "Content-Type", | |
"value": "application/json", | |
"description": "" | |
} | |
], | |
"body": { | |
"mode": "raw", | |
"raw": "{\n\t\"number\": {{next_slip_number}}\n}" | |
}, | |
"description": "" | |
}, | |
"response": [] | |
}, | |
{ | |
"name": "List slips copy", | |
"event": [ | |
{ | |
"listen": "test", | |
"script": { | |
"type": "text/javascript", | |
"exec": [ | |
"json_response = JSON.parse(responseBody);", | |
"foundId = false;", | |
"", | |
"json_response.forEach(function(elem){", | |
" if(elem.id == environment.slip_id){", | |
" foundId = true;", | |
" }", | |
"});", | |
"", | |
"tests[\"Status code is 200\"] = responseCode.code === 200;", | |
"tests[\"List contains create slip\"] = foundId;", | |
"", | |
"postman.setEnvironmentVariable(\"next_slip_number\", parseInt(json_response[json_response.length-1].number) + 1);" | |
] | |
} | |
} | |
], | |
"request": { | |
"url": "{{url}}/slip", | |
"method": "GET", | |
"header": [], | |
"body": {}, | |
"description": "" | |
}, | |
"response": [] | |
}, | |
{ | |
"name": "Get a slip copy", | |
"event": [ | |
{ | |
"listen": "test", | |
"script": { | |
"type": "text/javascript", | |
"exec": [ | |
"json_response = JSON.parse(responseBody)", | |
"", | |
"tests[\"Status code is 200\"] = responseCode.code === 200;", | |
"tests[\"Id matches created slip\"] = json_response.id.toString() === environment.slip_id.toString();" | |
] | |
} | |
} | |
], | |
"request": { | |
"url": "{{url}}/slip/{{slip_id}}", | |
"method": "GET", | |
"header": [], | |
"body": {}, | |
"description": "" | |
}, | |
"response": [] | |
}, | |
{ | |
"name": "Update a slip copy", | |
"event": [ | |
{ | |
"listen": "test", | |
"script": { | |
"type": "text/javascript", | |
"exec": [ | |
"json_response = JSON.parse(responseBody)", | |
"", | |
"tests[\"Status code is 200\"] = responseCode.code === 200;", | |
"tests[\"Slip number is updated\"] = json_response.number === parseInt(environment.next_slip_number);", | |
"", | |
"if (json_response.number){", | |
" postman.setEnvironmentVariable(\"next_slip_number\", parseInt(json_response.number) + 1);", | |
"}" | |
] | |
} | |
} | |
], | |
"request": { | |
"url": "{{url}}/slip/{{slip_id}}", | |
"method": "PATCH", | |
"header": [ | |
{ | |
"key": "Content-Type", | |
"value": "application/json", | |
"description": "" | |
} | |
], | |
"body": { | |
"mode": "raw", | |
"raw": "{\n\t\"number\": {{next_slip_number}}\n}" | |
}, | |
"description": "" | |
}, | |
"response": [] | |
}, | |
{ | |
"name": "Boat arrival to slip copy", | |
"event": [ | |
{ | |
"listen": "test", | |
"script": { | |
"type": "text/javascript", | |
"exec": [ | |
"json_response = JSON.parse(responseBody)", | |
"", | |
"tests[\"Status code is 200\"] = responseCode.code === 200;", | |
"tests[\"Slip contains a boat\"] = json_response.current_boat !== null;", | |
"tests[\"Arrival date is not null\"] = json_response.arrival_date !== null;" | |
] | |
} | |
} | |
], | |
"request": { | |
"url": "{{url}}/slip/{{slip_id}}/boat", | |
"method": "POST", | |
"header": [ | |
{ | |
"key": "Content-Type", | |
"value": "application/json", | |
"description": "" | |
} | |
], | |
"body": { | |
"mode": "raw", | |
"raw": "{\n\t\"boat_id\": \"{{boat_id}}\"\n}" | |
}, | |
"description": "" | |
}, | |
"response": [] | |
}, | |
{ | |
"name": "Slip already occupied", | |
"event": [ | |
{ | |
"listen": "test", | |
"script": { | |
"type": "text/javascript", | |
"exec": [ | |
"json_response = JSON.parse(responseBody)", | |
"", | |
"tests[\"Status code is 403\"] = responseCode.code === 403;" | |
] | |
} | |
} | |
], | |
"request": { | |
"url": "{{url}}/slip/{{slip_id}}/boat", | |
"method": "POST", | |
"header": [ | |
{ | |
"key": "Content-Type", | |
"value": "application/json", | |
"description": "" | |
} | |
], | |
"body": { | |
"mode": "raw", | |
"raw": "{\n\t\"boat_id\": \"{{boat_id}}\"\n}" | |
}, | |
"description": "" | |
}, | |
"response": [] | |
}, | |
{ | |
"name": "Boat departure from slip copy", | |
"event": [ | |
{ | |
"listen": "test", | |
"script": { | |
"type": "text/javascript", | |
"exec": [ | |
"tests[\"Status code is 200\"] = responseCode.code === 204;" | |
] | |
} | |
} | |
], | |
"request": { | |
"url": "{{url}}/slip/{{slip_id}}/boat", | |
"method": "DELETE", | |
"header": [ | |
{ | |
"key": "Content-Type", | |
"value": "application/json", | |
"description": "" | |
} | |
], | |
"body": { | |
"mode": "raw", | |
"raw": "" | |
}, | |
"description": "" | |
}, | |
"response": [] | |
}, | |
{ | |
"name": "Slip does not have a boat", | |
"event": [ | |
{ | |
"listen": "test", | |
"script": { | |
"type": "text/javascript", | |
"exec": [ | |
"tests[\"Slip doesn't have a boat\"] = responseCode.code === 400;" | |
] | |
} | |
} | |
], | |
"request": { | |
"url": "{{url}}/slip/{{slip_id}}/boat", | |
"method": "DELETE", | |
"header": [ | |
{ | |
"key": "Content-Type", | |
"value": "application/json", | |
"description": "" | |
} | |
], | |
"body": { | |
"mode": "raw", | |
"raw": "" | |
}, | |
"description": "" | |
}, | |
"response": [] | |
}, | |
{ | |
"name": "Delete a slip copy", | |
"event": [ | |
{ | |
"listen": "test", | |
"script": { | |
"type": "text/javascript", | |
"exec": [ | |
"tests[\"Status code is 204\"] = responseCode.code === 204;", | |
"" | |
] | |
} | |
} | |
], | |
"request": { | |
"url": "{{url}}/slip/{{slip_id}}", | |
"method": "DELETE", | |
"header": [], | |
"body": {}, | |
"description": "" | |
}, | |
"response": [] | |
}, | |
{ | |
"name": "Delete fails", | |
"event": [ | |
{ | |
"listen": "test", | |
"script": { | |
"type": "text/javascript", | |
"exec": [ | |
"tests[\"Status code is 404\"] = responseCode.code === 404;", | |
"" | |
] | |
} | |
} | |
], | |
"request": { | |
"url": "{{url}}/slip/{{slip_id}}", | |
"method": "DELETE", | |
"header": [], | |
"body": {}, | |
"description": "" | |
}, | |
"response": [] | |
}, | |
{ | |
"name": "Slip does not exist", | |
"event": [ | |
{ | |
"listen": "test", | |
"script": { | |
"type": "text/javascript", | |
"exec": [ | |
"json_response = JSON.parse(responseBody)", | |
"", | |
"tests[\"Status code is 404\"] = responseCode.code === 404;" | |
] | |
} | |
} | |
], | |
"request": { | |
"url": "{{url}}/slip/{{slip_id}}/boat", | |
"method": "POST", | |
"header": [ | |
{ | |
"key": "Content-Type", | |
"value": "application/json", | |
"description": "" | |
} | |
], | |
"body": { | |
"mode": "raw", | |
"raw": "{\n\t\"boat_id\": \"{{boat_id}}\"\n}" | |
}, | |
"description": "" | |
}, | |
"response": [] | |
} | |
] | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment