spec/session_spec.rb in patron-0.4.11 vs spec/session_spec.rb in patron-0.4.12

- old
+ new

@@ -241,9 +241,23 @@ body = YAML::load(response.body) }.should_not raise_error body.request_method.should == "GET" end + + it "should serialize query params and append them to the url" do + response = @session.request(:get, "/test", {}, :query => {:foo => "bar"}) + request = YAML::load(response.body) + request.parse + (request.path + '?' + request.query_string).should == "/test?foo=bar" + end + + it "should merge parameters in the :query option with pre-existing query parameters" do + response = @session.request(:get, "/test?foo=bar", {}, :query => {:baz => "quux"}) + request = YAML::load(response.body) + request.parse + (request.path + '?' + request.query_string).should == "/test?foo=bar&baz=quux" + end def encode_authz(user, passwd) "Basic " + Base64.encode64("#{user}:#{passwd}").strip end