mirror of
https://github.com/jnunemaker/httparty
synced 2023-03-27 23:23:07 -04:00
Fix query_string_normalization inconsistency
This commit is contained in:
parent
068dffa2fe
commit
93e9d02ec9
2 changed files with 4 additions and 4 deletions
|
@ -139,7 +139,7 @@ module HTTParty
|
|||
end
|
||||
|
||||
def query_string_normalizer
|
||||
options[:query_string_normalization]
|
||||
options[:query_string_normalizer]
|
||||
end
|
||||
|
||||
def setup_raw_request
|
||||
|
|
|
@ -99,7 +99,7 @@ describe HTTParty::Request do
|
|||
|
||||
it "respects the query string normalization proc" do
|
||||
empty_proc = lambda {|qs| ""}
|
||||
@request.options[:query_string_normalization] = empty_proc
|
||||
@request.options[:query_string_normalizer] = empty_proc
|
||||
@request.options[:query] = {:foo => :bar}
|
||||
URI.unescape(@request.uri.query).should == ""
|
||||
end
|
||||
|
@ -115,9 +115,9 @@ describe HTTParty::Request do
|
|||
end
|
||||
|
||||
describe "#setup_raw_request" do
|
||||
context "when query_string_normalization is set" do
|
||||
context "when query_string_normalizer is set" do
|
||||
it "sets the body to the return value of the proc" do
|
||||
@request.options[:query_string_normalization] = HTTParty::Request::NON_RAILS_QUERY_STRING_NORMALIZER
|
||||
@request.options[:query_string_normalizer] = HTTParty::Request::NON_RAILS_QUERY_STRING_NORMALIZER
|
||||
@request.options[:body] = {:page => 1, :foo => %w(bar baz)}
|
||||
@request.send(:setup_raw_request)
|
||||
body = @request.instance_variable_get(:@raw_request).body
|
||||
|
|
Loading…
Add table
Reference in a new issue