capybara-mechanize doesn't submit forms that contain hashes with arrays with hashes correctly

This input is not handled correctly:

<pre>
&lt;input id="cart_line_items__product_id" name="cart[line_items][][product_id]" value="2">
</pre>

This is how the form is submitted:

<pre>
{"cart"=>{"line_items"=>"[{\"product_id\"=>\"2\"}]"}}
</pre>

Note that the array is wrapped in a string.