#256 ✓resolved
Matt Fawcett

Webrat with Mechanize - Form data getting url encoded twice

Reported by Matt Fawcett | May 29th, 2009 @ 06:29 AM

Hi, Im using Cucumber with Webrat/Mechanize to test a PHP application and have run into an issue when submitting a form. Webrat url encodes the form values of a text field in the to_param method (field.rb) but when it gets passed through to the mechanize gem, it gets url encoded again. This happens in util.rb in the build_query_string method.

The result is that if you fill in say an email address, the server then receives a raw post of "sss%2540ss.com" instead of "sss%40ss.com". Iv changed the to_param method in field.rb so that if the configuration mode is :mechanize then it doesn't encode the value and lets mechanize take care of it.

Iv sent a pull request any my commit is at http://github.com/mattfawcett/webrat/commit/8d7944e4c13c8e54fbd1dc8...


Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Ruby Acceptance Testing for Web applications.

Shared Ticket Bins

People watching this ticket

Referenced by