PageRenderTime 12ms CodeModel.GetById 1ms app.highlight 8ms RepoModel.GetById 1ms app.codeStats 1ms

/features/handles_compressed_responses.feature

http://github.com/jnunemaker/httparty
Gherkin Specification | 40 lines | 34 code | 6 blank | 0 comment | 1 complexity | 400134d7b9b6b0de130105f613ff2d25 MD5 | raw file
 1Feature: Handles Compressed Responses
 2
 3  In order to save bandwidth
 4  As a developer
 5  I want to leverage Net::Http's built in transparent support for gzip and deflate content encoding
 6
 7  Scenario: Supports deflate encoding
 8    Given a remote deflate service
 9    And the response from the service has a body of '<h1>Some HTML</h1>'
10    And that service is accessed at the path '/deflate_service.html'
11    When I call HTTParty#get with '/deflate_service.html'
12    Then the return value should match '<h1>Some HTML</h1>'
13    And it should return a response without a content-encoding
14
15  Scenario: Supports gzip encoding
16    Given a remote gzip service
17    And the response from the service has a body of '<h1>Some HTML</h1>'
18    And that service is accessed at the path '/gzip_service.html'
19    When I call HTTParty#get with '/gzip_service.html'
20    Then the return value should match '<h1>Some HTML</h1>'
21    And it should return a response without a content-encoding
22
23  Scenario: Supports gzip encoding with explicit header set
24    Given a remote gzip service
25    And the response from the service has a body of '<h1>Some HTML</h1>'
26    And that service is accessed at the path '/gzip_service.html'
27    When I set my HTTParty header 'User-Agent' to value 'Party'
28    And I call HTTParty#get with '/gzip_service.html'
29    Then the return value should match '<h1>Some HTML</h1>'
30    And it should return a response without a content-encoding
31
32  Scenario: Supports deflate encoding with explicit header set
33    Given a remote deflate service
34    And the response from the service has a body of '<h1>Some HTML</h1>'
35    And that service is accessed at the path '/deflate_service.html'
36    When I set my HTTParty header 'User-Agent' to value 'Party'
37    And I call HTTParty#get with '/deflate_service.html'
38    Then the return value should match '<h1>Some HTML</h1>'
39    And it should return a response without a content-encoding
40