This project is archived and is in readonly mode.

#4745 ✓resolved
August Lilleaas

Hard setting path_parameters in functional tests for monkey patching friendliness

Reported by August Lilleaas | June 1st, 2010 @ 02:40 PM

ActionController::TestRequest#assign_parameters should hard set path_parameters. This is so that monkey patchers can safely override methods and use params (or it's alias parameters) without breaking functional tests.

Because of the way parameters is implemented, as soon as it is called, altering the contents of path_parameters has no effect on parameters. The current behavior is to alter path_parameters, which will not as intended alter what parameters returns, since it has already been set.

The issue is resolved by explicitly calling path_parameters=.

See attached patch, with test case and fix.

Comments and changes to this ticket

Create your profile

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

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Pages