Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add a test to make sure that the HTTP accept stuff gets passed along

  • Loading branch information...
commit 72aedc0da3265d5c899cc21324ffbec1d1ffd6e5 1 parent f48d4cd
Carl Lerche carllerche authored
Showing with 16 additions and 1 deletion.
  1. +3 −1 lib/kirk/client/exchange.rb
  2. +13 −0 spec/client/client_spec.rb
4 lib/kirk/client/exchange.rb
View
@@ -26,7 +26,9 @@ def prepare!(request)
if request.headers
request.headers.each do |name, val|
- self.set_request_header(name.to_s, val.to_s)
+ name = name.to_s
+ val = val.to_s
+ self.set_request_header(name, val)
end
end
13 spec/client/client_spec.rb
View
@@ -132,6 +132,19 @@ def on_response_complete(response)
response = parse_response(group.responses.first)
response["rack.input"].should == "zomg"
end
+
+ it "handles setting the content type" do
+ group = Kirk::Client.group do |g|
+ g.request :GET, "http://localhost:9090/", nil, nil, {
+ 'Accept' => 'multipart/mixed, application/json;q=0.7, */*;q=0.5',
+ 'X-Riak-ClientId' => '12345'
+ }
+ end
+
+ response = parse_response(group.responses.first)
+ response['HTTP_ACCEPT'].should == 'multipart/mixed, application/json;q=0.7, */*;q=0.5'
+ response['HTTP_X_RIAK_CLIENTID'].should == '12345'
+ end
end
it "sets the response status when it is successful" do
Please sign in to comment.
Something went wrong with that request. Please try again.