Created
March 16, 2012 15:21
-
-
Save commuterjoy/2050512 to your computer and use it in GitHub Desktop.
gzip test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'json' | |
Before do | |
@random_token = rand(10000) | |
end | |
Then /^the page should be compressed$/ do | |
response = RestClient.get("#{host}/news?#{@random_token}", { :accept_encoding => 'gzip' }) | |
response.headers[:content_encoding].should include 'gzip' | |
response.headers[:vary].should include 'Accept-Encoding' | |
end | |
Then /^the page should \*not\* be compressed$/ do | |
response = RestClient.get("#{host}/news?#{@random_token}", { :accept_encoding => 'gzip', :x_news_setshowadverts => 'yes' }) | |
response.headers[:content_encoding].should_not include 'gzip' | |
response.headers[:vary].should_not include 'Accept-Encoding' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment