spec/lib/curb-fu/request/base_spec.rb in curb-fu-0.4.3 vs spec/lib/curb-fu/request/base_spec.rb in curb-fu-0.4.4
- old
+ new
@@ -47,10 +47,13 @@
end
it 'should append a query string if a query string is given' do
TestHarness.build_url('http://chocolatecheese.com','?nuts=true').
should == 'http://chocolatecheese.com?nuts=true'
end
+ it "should accept a 'protocol' parameter" do
+ TestHarness.build_url(:host => "mybank.com", :protocol => "https").should == "https://mybank.com"
+ end
end
describe "get" do
it "should get the google" do
@mock_curb = mock(Curl::Easy, :headers= => nil, :headers => {}, :header_str => "", :response_code => 200, :body_str => 'yeeeah', :timeout= => nil, :http_get => nil)
@@ -194,11 +197,11 @@
TestHarness.create_put_fields("my awesome data that I'm sending to you").
should == "my awesome data that I'm sending to you"
end
it 'should handle multiple parameters' do
- TestHarness.create_put_fields(:rock => 'beatles', :rap => '2pac').
- should == "rock=beatles&rap=2pac"
+ TestHarness.create_put_fields(:rock => 'beatles', :rap => '2pac').split("&").
+ should include("rock=beatles","rap=2pac")
end
it "should handle params that contain arrays" do
TestHarness.create_put_fields('q' => ['derek','matt']).
should == "q=derek,matt"