@@ -58,15 +58,39 @@ Feature: Authorization checking
5858 """
5959 Then the response status code should be 201
6060
61- Scenario : An user cannot retrieve an item he doesn't own
61+ Scenario : A user cannot retrieve an item he doesn't own
6262 When I add "Accept" header equal to "application/ld+json"
6363 And I add "Authorization" header equal to "Basic ZHVuZ2xhczprZXZpbg=="
6464 And I send a "GET" request to "/secured_dummies/1"
6565 Then the response status code should be 403
6666 And the response should be in JSON
6767
68- Scenario : An user can retrieve an item he owns
68+ Scenario : A user can retrieve an item he owns
6969 When I add "Accept" header equal to "application/ld+json"
7070 And I add "Authorization" header equal to "Basic ZHVuZ2xhczprZXZpbg=="
7171 And I send a "GET" request to "/secured_dummies/2"
7272 Then the response status code should be 200
73+
74+ Scenario : A user can't assign him an item he doesn't own
75+ When I add "Accept" header equal to "application/ld+json"
76+ And I add "Content-Type" header equal to "application/ld+json"
77+ And I add "Authorization" header equal to "Basic YWRtaW46a2l0dGVu"
78+ And I send a "PUT" request to "/secured_dummies/2" with body:
79+ """
80+ {
81+ "owner": "kitten"
82+ }
83+ """
84+ Then the response status code should be 403
85+
86+ Scenario : A user can update an item he owns and transfer it
87+ When I add "Accept" header equal to "application/ld+json"
88+ And I add "Content-Type" header equal to "application/ld+json"
89+ And I add "Authorization" header equal to "Basic ZHVuZ2xhczprZXZpbg=="
90+ And I send a "PUT" request to "/secured_dummies/2" with body:
91+ """
92+ {
93+ "owner": "vincent"
94+ }
95+ """
96+ Then the response status code should be 200
0 commit comments