Fix for #161 When using Rails 2.3 it uses Rack::Utils to parse params
This commit is contained in:
parent
00433bafe5
commit
740bb293e3
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
* Minor enhancements
|
* Minor enhancements
|
||||||
|
|
||||||
|
* When using Rails 2.3, use Rack::Utils to parse params (Matthew Ford)
|
||||||
* Initial Merb and Sinatra compatibility for Selenium mode (Corey Donohoe)
|
* Initial Merb and Sinatra compatibility for Selenium mode (Corey Donohoe)
|
||||||
* Add application_framework config for Selenium mode to determine how to
|
* Add application_framework config for Selenium mode to determine how to
|
||||||
start and stop the app server (Corey Donohoe)
|
start and stop the app server (Corey Donohoe)
|
||||||
|
|
|
@ -80,7 +80,7 @@ module Webrat
|
||||||
|
|
||||||
case Webrat.configuration.mode
|
case Webrat.configuration.mode
|
||||||
when :rails
|
when :rails
|
||||||
rails_request_parser.parse_query_parameters("#{name}=#{escaped_value}")
|
parse_rails_request_params("#{name}=#{escaped_value}")
|
||||||
when :merb
|
when :merb
|
||||||
::Merb::Parse.query("#{name}=#{escaped_value}")
|
::Merb::Parse.query("#{name}=#{escaped_value}")
|
||||||
else
|
else
|
||||||
|
@ -98,12 +98,15 @@ module Webrat
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
||||||
def rails_request_parser
|
def parse_rails_request_params(params)
|
||||||
if defined?(ActionController::AbstractRequest)
|
if defined?(ActionController::AbstractRequest)
|
||||||
ActionController::AbstractRequest
|
ActionController::AbstractRequest.parse_query_parameters(params)
|
||||||
else
|
elsif defined?(ActionController::UrlEncodedPairParser)
|
||||||
# For Rails > 2.2
|
# For Rails > 2.2
|
||||||
ActionController::UrlEncodedPairParser
|
ActionController::UrlEncodedPairParser.parse_query_parameters(params)
|
||||||
|
else
|
||||||
|
# For Rails > 2.3
|
||||||
|
Rack::Utils.parse_nested_query(params)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue