@@ -58,15 +58,39 @@ Feature: Authorization checking
58
58
"""
59
59
Then the response status code should be 201
60
60
61
- Scenario : An user cannot retrieve an item he doesn't own
61
+ Scenario : A user cannot retrieve an item he doesn't own
62
62
When I add "Accept" header equal to "application/ld+json"
63
63
And I add "Authorization" header equal to "Basic ZHVuZ2xhczprZXZpbg=="
64
64
And I send a "GET" request to "/secured_dummies/1"
65
65
Then the response status code should be 403
66
66
And the response should be in JSON
67
67
68
- Scenario : An user can retrieve an item he owns
68
+ Scenario : A user can retrieve an item he owns
69
69
When I add "Accept" header equal to "application/ld+json"
70
70
And I add "Authorization" header equal to "Basic ZHVuZ2xhczprZXZpbg=="
71
71
And I send a "GET" request to "/secured_dummies/2"
72
72
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