Compare commits
2 Commits
rails_atta
...
master
Author | SHA1 | Date |
---|---|---|
John Bintz | 5e4ffeae9f | |
John Bintz | 0856d8d405 |
|
@ -110,7 +110,7 @@ module Webrat
|
|||
when :rack, :sinatra
|
||||
Rack::Utils.parse_nested_query(query_string)
|
||||
else
|
||||
query_string.split('&').map {|query| { query.split('=').first => query.split('=').last }}
|
||||
Hash[query_string.split('&').map {|query| [ query.split('=').first, query.split('=').last ]}]
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -48,4 +48,22 @@ describe "Multiple nested params" do
|
|||
webrat_session.should_receive(:post).with("/family", params)
|
||||
click_button
|
||||
end
|
||||
|
||||
it "should correctly construct a query string" do
|
||||
Webrat.configuration.mode = :mechanize
|
||||
|
||||
with_html <<-HTML
|
||||
<html>
|
||||
<form method="get" action="/search">
|
||||
<input type="text" name="query" value="my-query" />
|
||||
<input type="submit" />
|
||||
</form>
|
||||
</html>
|
||||
HTML
|
||||
|
||||
params = { "query" => "my-query" }
|
||||
|
||||
webrat_session.should_receive(:get).with("/search", params)
|
||||
click_button
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue