Test for Resource#head

This commit is contained in:
tpresa 2010-09-16 15:59:41 +02:00 committed by Julien Kirch
parent edb31a626c
commit 41e254e6c0
2 changed files with 9 additions and 0 deletions

View File

@ -1,3 +1,7 @@
# 1.6.2
- add support for HEAD in resources (patch provided by tpresa)
# 1.6.1
- add response body in Exception#inspect

View File

@ -14,6 +14,11 @@ describe RestClient::Resource do
@resource.get
end
it "HEAD" do
RestClient::Request.should_receive(:execute).with(:method => :head, :url => 'http://some/resource', :headers => {'X-Something' => '1'}, :user => 'jane', :password => 'mypass')
@resource.head
end
it "POST" do
RestClient::Request.should_receive(:execute).with(:method => :post, :url => 'http://some/resource', :payload => 'abc', :headers => {:content_type => 'image/jpg', 'X-Something' => '1'}, :user => 'jane', :password => 'mypass')
@resource.post 'abc', :content_type => 'image/jpg'