Skip to content

Commit

Permalink
add test for etag & last-modified headers
Browse files Browse the repository at this point in the history
  • Loading branch information
igrigorik committed Aug 14, 2010
1 parent 3b71730 commit 6c5a6ec
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
14 changes: 14 additions & 0 deletions spec/request_spec.rb
Expand Up @@ -296,6 +296,20 @@ def failed
}
end

it "should return ETag and Last-Modified headers" do
EventMachine.run {
http = EventMachine::HttpRequest.new('http://127.0.0.1:8080/echo_query').get

http.errback { failed }
http.callback {
http.response_header.status.should == 200
http.response_header.etag.should match('abcdefg')
http.response_header.last_modified.should match('Fri, 13 Aug 2010 17:31:21 GMT')
EventMachine.stop
}
}
end

it "should detect deflate encoding" do
EventMachine.run {

Expand Down
2 changes: 2 additions & 0 deletions spec/stallion.rb
Expand Up @@ -78,6 +78,8 @@ def self.call(env)
stable.response.write 'test'

elsif stable.request.path_info == '/echo_query'
stable.response["ETag"] = "abcdefg"
stable.response["Last-Modified"] = "Fri, 13 Aug 2010 17:31:21 GMT"
stable.response.write stable.request.query_string

elsif stable.request.path_info == '/echo_content_length'
Expand Down

0 comments on commit 6c5a6ec

Please sign in to comment.