source: sandbox/2.4.1-3/prototype/library/tonic/features/response.feature @ 6351

Revision 6351, 2.3 KB checked in by gustavo, 12 years ago (diff)

Ticket #2768 - Melhorias na inserção de destinatários na criacao de mensagem

  • Property svn:executable set to *
Line 
1Feature: Response object
2  In order to output a response representation
3  As a PHP developer
4  I want a PHP object that represents a HTTP response
5 
6  Scenario: Output should be gzipped if the client supports it
7    Given the request URI of "/resourcetest/one"
8    And an accept encoding of "gzip"
9    When I create a request object
10    And I load the resource
11    And execute the request
12    And I process content encoding
13    Then the response header "Content-Encoding" should contain 'gzip'
14    And the response body should be gzipped and be "test"
15
16  Scenario: Output should be deflated if the client supports it
17    Given the request URI of "/resourcetest/one"
18    And an accept encoding of "deflate"
19    When I create a request object
20    And I load the resource
21    And execute the request
22    And I process content encoding
23    Then the response header "Content-Encoding" should contain 'deflate'
24    And the response body should be deflated and be "test"
25
26  Scenario: Output should be compress if the client supports it
27    Given the request URI of "/resourcetest/one"
28    And an accept encoding of "compress"
29    When I create a request object
30    And I load the resource
31    And execute the request
32    And I process content encoding
33    Then the response header "Content-Encoding" should contain 'compress'
34    And the response body should be compressed and be "test"
35
36  Scenario: Responses should have a default cache header
37    Given the request URI of "/resourcetest/one"
38    When I create a request object
39    And I load the resource
40    And execute the request
41    And I add a cache header of ""
42    Then the response header "Cache-Control" should contain 'max-age=86400, must-revalidate'
43
44  Scenario: Responses told not to cache should send a zero cache header
45    Given the request URI of "/resourcetest/one"
46    When I create a request object
47    And I load the resource
48    And execute the request
49    And I add a cache header of "0"
50    Then the response header "Cache-Control" should contain 'no-cache'
51
52  Scenario: Responses given an etag should send an etag response header
53    Given the request URI of "/resourcetest/one"
54    When I create a request object
55    And I load the resource
56    And execute the request
57    And I add an etag header of "123123"
58    Then the response header "Etag" should contain '"123123"'
Note: See TracBrowser for help on using the repository browser.