@@ -19,15 +19,26 @@ POST should create an object
19
19
Dictionary Should Contain Item ${response.json() } counter 1
20
20
21
21
GET should return a value
22
- ${response } = Get Request api /v1/categories/count
23
- Status Should Be 200 ${response }
24
- Dictionary Should Contain Item ${response.json() } counter 1
22
+ ${response } = Get Request api /v1/categories/1
23
+ ${body } = Set Variable ${response.json() }
24
+ Status Should Be 200 ${response }
25
+ Should Be Equal ${response.headers['Content-Type'] } application/json; charset=utf-8
26
+ &{expected } = Create Dictionary id=${1 } name=Sport name_ru=${null } slug=sport
27
+ Dictionaries Should Be Equal ${body } ${expected }
25
28
26
29
27
30
PUT should update an object
28
- &{payload } = Create Dictionary name=Fauna nameRu=Фауна slug=fauna userId=1
29
- ${response } = Put Request api /v1/categories/1 json=${payload }
30
- Status Should Be 204 ${response }
31
+ &{payload } = Create Dictionary name=Fauna nameRu=Фауна slug=fauna userId=1
32
+ ${response } = Put Request api /v1/categories/1 json=${payload }
33
+ Status Should Be 204 ${response }
34
+ # checks that it was updated
35
+ ${response } = Get Request api /v1/categories/1
36
+ ${body } = Set Variable ${response.json() }
37
+ Status Should Be 200 ${response }
38
+ Should Be Equal ${response.headers['Content-Type'] } application/json; charset=utf-8
39
+ Dictionary Should Contain Item ${body } name Fauna
40
+ Dictionary Should Contain Item ${body } name_ru Фауна
41
+ Dictionary Should Contain Item ${body } slug fauna
31
42
32
43
DELETE should remove an object
33
44
${response } = Delete Request api /v1/categories/1
0 commit comments