-
Notifications
You must be signed in to change notification settings - Fork 0
/
Test API.postman_collection.json
191 lines (191 loc) · 4.82 KB
/
Test API.postman_collection.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
{
"info": {
"_postman_id": "c18f549c-1434-49d6-ae69-b7f745922160",
"name": "Test API",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "19276358"
},
"item": [
{
"name": "retrieve the highest and lowest rating review for agiven company",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Successful POST request\", () => {\r",
" pm.expect(pm.response.code).to.be.oneOf([200]);\r",
"});\r",
"\r",
"pm.test(\"Response time is less than 200ms\", () => {\r",
" pm.expect(pm.response.responseTime).to.be.below(200);\r",
"});\r",
"\r",
"pm.test(\"Content-Type header is present\", () => {\r",
" pm.response.to.have.header(\"Content-Type\");\r",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\r\n \"company_id\": \"2\"\r\n}"
},
"url": {
"raw": "http://localhost/api/ratinghighlow",
"protocol": "http",
"host": [
"localhost"
],
"path": [
"api",
"ratinghighlow"
]
},
"description": "endpoint to get the highest and lowest rating review for a given company (using the id of a company \"company_id\")"
},
"response": []
},
{
"name": "submit a review",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Successful POST request\", () => {\r",
" pm.expect(pm.response.code).to.be.oneOf([200]);\r",
"});\r",
"\r",
"pm.test(\"Response time is less than 200ms\", () => {\r",
" pm.expect(pm.response.responseTime).to.be.below(200);\r",
"});\r",
"\r",
"pm.test(\"Content-Type header is present\", () => {\r",
" pm.response.to.have.header(\"Content-Type\");\r",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\r\n \"title\": \"Let's create a review yay\",\r\n \"user\": \"1\",\r\n \"company\": \"1\",\r\n \"culture\": \"5\",\r\n \"management\": \"5\",\r\n \"work_live_balance\": \"5\",\r\n \"career_development\": \"5\",\r\n \"pro\": \"teste\",\r\n \"contra\": \"sem contras\",\r\n \"suggestions\": \"teste\"\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "http://localhost/api/submitreview",
"protocol": "http",
"host": [
"localhost"
],
"path": [
"api",
"submitreview"
]
},
"description": "submit a review"
},
"response": []
},
{
"name": "users who reviewed",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Successful POST request\", () => {\r",
" pm.expect(pm.response.code).to.be.oneOf([200]);\r",
"});\r",
"\r",
"pm.test(\"Response time is less than 200ms\", () => {\r",
" pm.expect(pm.response.responseTime).to.be.below(200);\r",
"});\r",
"\r",
"pm.test(\"Content-Type header is present\", () => {\r",
" pm.response.to.have.header(\"Content-Type\");\r",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\r\n \"company_id\": \"5\"\r\n}"
},
"url": {
"raw": "http://localhost/api/userswhoreviewed",
"protocol": "http",
"host": [
"localhost"
],
"path": [
"api",
"userswhoreviewed"
]
},
"description": "\"users who reviewed this company also reviewed\" functionality: Given a particular company list other companies that other users also reviewed"
},
"response": []
},
{
"name": "list of top 10 recommended companies",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Successful GET request\", () => {\r",
" pm.expect(pm.response.code).to.be.oneOf([200]);\r",
"});\r",
"\r",
"pm.test(\"Response time is less than 200ms\", () => {\r",
" pm.expect(pm.response.responseTime).to.be.below(200);\r",
"});\r",
"\r",
"pm.test(\"Content-Type header is present\", () => {\r",
" pm.response.to.have.header(\"Content-Type\");\r",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "http://localhost/api/topcompanies",
"protocol": "http",
"host": [
"localhost"
],
"path": [
"api",
"topcompanies"
]
},
"description": "endpoint to get top 10 recommended companies"
},
"response": []
}
]
}