This project is archived and is in readonly mode.
add test case to specify behaviour of _assigns in ActionView::TestCase
-
David Chelimsky
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
Here's yet another alternative! This one uses
_user_defined... internally to clarify the separation between them and internally defined ivars, but exposesview_assignsto align with controllers.http://github.com/dchelimsky/rails/commit/14bf17deb8fc8235b3a4f989d...
-
Repository
- State changed from new to resolved
(from [2380c71601e12bcedc849e99d7a4f4ef6151baf2]) Added test case to specify that _assigns returns a Hash in AV::TC
[#5751 add test case to specify behaviour of _assigns in ActionView::TestCase state:resolved]
Signed-off-by: Santiago Pastorino santiago@wyeworks.com
http://github.com/rails/rails/commit/2380c71601e12bcedc849e99d7a4f4... -
Repository
(from [f656796d05715174568536cfe119a3959a020f23]) Rename _assigns to view_assigns in AV::TC
- also add tests
- also deprecate _assigns
[#5751 add test case to specify behaviour of _assigns in ActionView::TestCase state:resolved]
Signed-off-by: Santiago Pastorino santiago@wyeworks.com
http://github.com/rails/rails/commit/f656796d05715174568536cfe119a3... -
David Chelimsky
Great. Thanks!
-
David Chelimsky
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
Spoke w/ José and we agreed
view_assignsshould be added and_assignsdeprecated on the 3-0-stable branch (so_assignscan 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
Automatic cleanup of spam.