spec/httpi/adapter/curb_spec.rb in httpi-0.7.0 vs spec/httpi/adapter/curb_spec.rb in httpi-0.7.1

- old
+ new

@@ -39,10 +39,17 @@ it "should return a valid HTTPI::Response" do adapter.post(basic_request).should match_response(:body => Fixture.xml) end end + describe "#post includes body of request" do + it "should send the body in the request" do + curb.expects(:http_post).with('xml=hi&name=123') + adapter.post(basic_request { |request| request.body = 'xml=hi&name=123' } ) + end + end + describe "#head" do before do curb.expects(:http_head) curb.expects(:response_code).returns(200) curb.expects(:header_str).returns("") @@ -62,9 +69,16 @@ curb.expects(:body_str).returns(Fixture.xml) end it "should return a valid HTTPI::Response" do adapter.put(basic_request).should match_response(:body => Fixture.xml) + end + end + + describe "#put includes body of request" do + it "should send the body in the request" do + curb.expects(:http_put).with('xml=hi&name=123') + adapter.put(basic_request { |request| request.body = 'xml=hi&name=123' } ) end end describe "#delete" do before do