This project is archived and is in readonly mode.

#5956 ✓resolved
Larry Sprock

[PATCH] ActionDispatch::TestProcess::assigns breaks array tests due to HashWithIndifferentAccess

Reported by Larry Sprock | November 12th, 2010 @ 12:53 AM

I ran across this issue while upgrading a large, well tested app to rails3. Basically, anywhere in the specs where we where testing for a WillPaginate::Collection or methods on a WillPaginate::Collection would fail. I narrowed it down to HashWithIndifferentAccess replacing arrays or anything subclassing arrays with a new array via collect (#convert_value hash_with_indifferent_access.rb:143).

I would like some help resolving this issue. The attached patch is a first pass at fixing it and it works for the general use case, however, problems arise if you use caching which basically creates a frozen object. Any array that is frozen throws an exception because replace is trying to modify the array...

Example of failing test: https://gist.github.com/667961

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>

Attachments

Pages