59 lines
1.5 KiB
JSON
59 lines
1.5 KiB
JSON
{
|
|
"info": {
|
|
"name": "Todo API",
|
|
"_postman_id": "11111111-1111-1111-1111-111111111111",
|
|
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
|
|
},
|
|
"item": [
|
|
{
|
|
"name": "GET dashboard",
|
|
"request": {
|
|
"method": "GET",
|
|
"url": "{{baseUrl}}/dashboard"
|
|
},
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"exec": [
|
|
"pm.test('status 200', function () {",
|
|
" pm.response.to.have.status(200);",
|
|
"});"
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "POST create todo",
|
|
"request": {
|
|
"method": "POST",
|
|
"header": [
|
|
{ "key": "Content-Type", "value": "application/x-www-form-urlencoded" }
|
|
],
|
|
"body": {
|
|
"mode": "urlencoded",
|
|
"urlencoded": [
|
|
{ "key": "title", "value": "Newman todo", "type": "text" },
|
|
{ "key": "description", "value": "Created by newman", "type": "text" },
|
|
{ "key": "status", "value": "not-started", "type": "text" }
|
|
]
|
|
},
|
|
"url": "{{baseUrl}}/todo/create"
|
|
},
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"exec": [
|
|
"pm.test('status is 200 or redirect', function () {",
|
|
" pm.expect([200, 302]).to.include(pm.response.code);",
|
|
"});"
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|