2010-06-09 19:00:41 -04:00
|
|
|
Feature: Handles Compressed Responses
|
|
|
|
|
|
|
|
In order to save bandwidth
|
|
|
|
As a developer
|
2019-11-28 15:05:50 -08:00
|
|
|
I want to leverage Net::Http's built in transparent support for gzip and deflate content encoding
|
2010-06-09 19:00:41 -04:00
|
|
|
|
|
|
|
Scenario: Supports deflate encoding
|
|
|
|
Given a remote deflate service
|
|
|
|
And the response from the service has a body of '<h1>Some HTML</h1>'
|
2010-07-07 08:54:22 -04:00
|
|
|
And that service is accessed at the path '/deflate_service.html'
|
|
|
|
When I call HTTParty#get with '/deflate_service.html'
|
2010-06-09 19:00:41 -04:00
|
|
|
Then the return value should match '<h1>Some HTML</h1>'
|
2019-11-28 15:05:50 -08:00
|
|
|
And it should return a response without a content-encoding
|
2010-06-12 00:41:11 -04:00
|
|
|
|
|
|
|
Scenario: Supports gzip encoding
|
|
|
|
Given a remote gzip service
|
|
|
|
And the response from the service has a body of '<h1>Some HTML</h1>'
|
2010-07-07 08:54:22 -04:00
|
|
|
And that service is accessed at the path '/gzip_service.html'
|
|
|
|
When I call HTTParty#get with '/gzip_service.html'
|
2010-06-12 00:41:11 -04:00
|
|
|
Then the return value should match '<h1>Some HTML</h1>'
|
2019-11-28 15:05:50 -08:00
|
|
|
And it should return a response without a content-encoding
|
2013-08-05 14:17:52 -04:00
|
|
|
|
2019-11-28 15:05:50 -08:00
|
|
|
Scenario: Supports gzip encoding with explicit header set
|
2013-08-05 14:17:52 -04:00
|
|
|
Given a remote gzip service
|
2019-11-28 15:05:50 -08:00
|
|
|
And the response from the service has a body of '<h1>Some HTML</h1>'
|
|
|
|
And that service is accessed at the path '/gzip_service.html'
|
|
|
|
When I set my HTTParty header 'User-Agent' to value 'Party'
|
|
|
|
And I call HTTParty#get with '/gzip_service.html'
|
|
|
|
Then the return value should match '<h1>Some HTML</h1>'
|
|
|
|
And it should return a response without a content-encoding
|
|
|
|
|
|
|
|
Scenario: Supports deflate encoding with explicit header set
|
|
|
|
Given a remote deflate service
|
|
|
|
And the response from the service has a body of '<h1>Some HTML</h1>'
|
|
|
|
And that service is accessed at the path '/deflate_service.html'
|
|
|
|
When I set my HTTParty header 'User-Agent' to value 'Party'
|
|
|
|
And I call HTTParty#get with '/deflate_service.html'
|
|
|
|
Then the return value should match '<h1>Some HTML</h1>'
|
|
|
|
And it should return a response without a content-encoding
|
|
|
|
|