This project is archived and is in readonly mode.
add test case to specify behaviour of _assigns in ActionView::TestCase
Reported by David Chelimsky | October 2nd, 2010 @ 01:15 PM
http://github.com/rails/rails/commit/e66c1cee86aba1c81152f3d0872313...
changed the behaviour of ActionView::TestCase@_assigns
to return an Array instead of a Hash. This broke extensions that
rely on _assigns
, so http://github.com/rails/rails/commit/b95152201871f076a0d5c95e9e6387...
reverted it.
Forthcoming patch adds a test case, which specifies that
_assigns
returns a Hash.
Comments and changes to this ticket
-
David Chelimsky October 2nd, 2010 @ 06:17 PM
Here's a different patch that also renames _assigns to user_defined_ivar_map (more self-documenting):
http://github.com/dchelimsky/rails/commit/401630298c59aecb468bcfd4d...
-
David Chelimsky October 2nd, 2010 @ 06:37 PM
Here's yet another alternative! This one uses
_user_defined
... internally to clarify the separation between them and internally defined ivars, but exposesview_assigns
to align with controllers.http://github.com/dchelimsky/rails/commit/14bf17deb8fc8235b3a4f989d...
-
Repository October 3rd, 2010 @ 04:30 PM
- State changed from new to resolved
(from [2380c71601e12bcedc849e99d7a4f4ef6151baf2]) Added test case to specify that _assigns returns a Hash in AV::TC
[#5751 state:resolved]
Signed-off-by: Santiago Pastorino santiago@wyeworks.com
http://github.com/rails/rails/commit/2380c71601e12bcedc849e99d7a4f4... -
Repository October 3rd, 2010 @ 04:37 PM
(from [f656796d05715174568536cfe119a3959a020f23]) Rename _assigns to view_assigns in AV::TC
- also add tests
- also deprecate _assigns
[#5751 state:resolved]
Signed-off-by: Santiago Pastorino santiago@wyeworks.com
http://github.com/rails/rails/commit/f656796d05715174568536cfe119a3... -
David Chelimsky October 4th, 2010 @ 03:02 PM
Hi Santiago. I see that you merged one patch to rails/3-0-stable and another to master. My hope was for the last patch to replace the others and be merged to both 3-0-stable and master.
The intent was to deprecate _assigns as of 3.0.1 so it could be removed when 3.1.0 is released (I can add another patch for master to remove it from 3.1.0 if you like).
Also, re: the test case, I see you modified it to allow for internally defined instance variables, but my intent was to lock down the content of view_assigns to include only user defined instance variables. That keeps the view free of instance variables that are used internally by ActionView::TestCase.
WDYT?
I also see you modified the test case to allow for other instance variables making it into _assigns.
My intent was for the last patch (https://rails.lighthouseapp.com/projects/8994/changesets/f656796d05...) to replace the others with the hope that it would be merged to both 3-0-stable
-
David Chelimsky October 4th, 2010 @ 04:12 PM
Spoke w/ José and we agreed
view_assigns
should be added and_assigns
deprecated on the 3-0-stable branch (so_assigns
can be removed from 3.1).Here's a new patch which brings my changes to 3-0-stable, leaving Santiago's perf improvement on view_assigns intact:
http://github.com/dchelimsky/rails/commit/33706a0db290ab22aaaa56b7e...
-
Ryan Bigg October 11th, 2010 @ 12:10 PM
- Importance changed from to Low
Automatic cleanup of spam.
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>
People watching this ticket
Referenced by
- 5751 add test case to specify behaviour of _assigns in ActionView::TestCase [#5751 state:resolved]
- 5751 add test case to specify behaviour of _assigns in ActionView::TestCase [#5751 state:resolved]