spec/response_spec.rb in patron-0.4.16 vs spec/response_spec.rb in patron-0.4.17
- old
+ new
@@ -41,9 +41,15 @@
it "should return an array of values when multiple header fields have same name" do
response = @session.get("/repetitiveheader")
response.headers['Set-Cookie'].should == ["a=1","b=2"]
end
+ it "should works with non-text files" do
+ response = @session.get("/picture")
+ response.headers['Content-Type'].should == 'image/png'
+ response.body.encoding.should == Encoding::ASCII_8BIT
+ end
+
it "should not allow a default charset to be nil" do
Encoding.stub(:default_internal).and_return("UTF-8")
expect {
Patron::Response.new("url", "status", 0, "", "", nil)
}.to_not raise_error