not passing empty params
This commit is contained in:
parent
ddd0dd70c3
commit
ff36b51adb
|
@ -34,7 +34,7 @@ module Webrat
|
|||
|
||||
protected
|
||||
def do_request(url, data, headers, method)
|
||||
@response = request(url, :params => data, :headers => headers, :method => method)
|
||||
@response = request(url, :params => (data && data.any?) ? data : nil, :headers => headers, :method => method)
|
||||
self.get(@response.headers['Location'], nil, @response.headers) if @response.status == 302
|
||||
end
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ describe Webrat::Session do
|
|||
session = Webrat::Session.new
|
||||
response = OpenStruct.new
|
||||
response.status = 200
|
||||
session.should_receive(:request).with('url', {:params=>{}, :method=>"GET", :headers=>nil}).and_return(response)
|
||||
session.should_receive(:request).with('url', {:params=> nil, :method=>"GET", :headers=>nil}).and_return(response)
|
||||
session.get('url', {}, nil)
|
||||
end
|
||||
|
||||
|
@ -17,7 +17,7 @@ describe Webrat::Session do
|
|||
response = OpenStruct.new
|
||||
response.status = 200
|
||||
|
||||
session.should_receive(:request).with('url', {:params=>{}, :method=>request_method.upcase, :headers=>nil}).and_return(response)
|
||||
session.should_receive(:request).with('url', {:params=>nil, :method=>request_method.upcase, :headers=>nil}).and_return(response)
|
||||
session.send(request_method, 'url', {}, nil)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue