@@ -22,7 +22,7 @@ Feature: Content Negotiation support
22
22
<response><description/><dummy/><dummyBoolean/><dummyDate/><dummyFloat/><dummyPrice/><relatedDummy/><relatedDummies/><jsonData/><arrayData/><name_converted/><relatedOwnedDummy/><relatedOwningDummy/><id>1</id><name>XML!</name><alias/><foo/></response>
23
23
"""
24
24
25
- Scenario : Retrieve a collection in XML
25
+ Scenario : Retrieve a collection in XML
26
26
When I add "Accept" header equal to "text/xml"
27
27
And I send a "GET" request to "/dummies"
28
28
Then the response status code should be 200
@@ -34,7 +34,7 @@ Feature: Content Negotiation support
34
34
<response><item key="0"><description/><dummy/><dummyBoolean/><dummyDate/><dummyFloat/><dummyPrice/><relatedDummy/><relatedDummies/><jsonData/><arrayData/><name_converted/><relatedOwnedDummy/><relatedOwningDummy/><id>1</id><name>XML!</name><alias/><foo/></item></response>
35
35
"""
36
36
37
- Scenario : Retrieve a collection in XML using the .xml URL
37
+ Scenario : Retrieve a collection in XML using the .xml URL
38
38
When I send a "GET" request to "/dummies.xml"
39
39
Then the response status code should be 200
40
40
And the header "Content-Type" should be equal to "application/xml; charset=utf-8"
@@ -45,7 +45,7 @@ Feature: Content Negotiation support
45
45
<response><item key="0"><description/><dummy/><dummyBoolean/><dummyDate/><dummyFloat/><dummyPrice/><relatedDummy/><relatedDummies/><jsonData/><arrayData/><name_converted/><relatedOwnedDummy/><relatedOwningDummy/><id>1</id><name>XML!</name><alias/><foo/></item></response>
46
46
"""
47
47
48
- Scenario : Retrieve a collection in JSON
48
+ Scenario : Retrieve a collection in JSON
49
49
When I add "Accept" header equal to "application/json"
50
50
And I send a "GET" request to "/dummies"
51
51
Then the response status code should be 200
@@ -155,3 +155,17 @@ Feature: Content Negotiation support
155
155
id,name
156
156
1,Kevin
157
157
"""
158
+
159
+ Scenario : Get a security response in JSON
160
+ Given there are 1 SecuredDummy objects
161
+ And I add "Accept" header equal to "application/json"
162
+ When I send a "GET" request to "/secured_dummies"
163
+ Then the response status code should be 401
164
+ And the header "Content-Type" should be equal to "application/json"
165
+ And the response should be in JSON
166
+ And the JSON should be equal to:
167
+ """
168
+ {
169
+ "message": "Authentication Required"
170
+ }
171
+ """
0 commit comments