This project is archived and is in readonly mode.

View Test Case _assigns is locked on first reference to _view
Reported by David Chelimsky | June 22nd, 2010 @ 04:15 PM
Example:
_view.stubs(:current_user).returns(@user)
@foo = 'bar'
render :template => "some/template.html.erb"
In this case, the @foo variable is expected to be
available to the view, but it is not because _assigns
gets passed in to the view when you reference
_view.
I'll work up a patch for this in the next day or so.
Comments and changes to this ticket
- 
            
         
- 
         Repository June 23rd, 2010 @ 02:07 PM- State changed from new to resolved
 (from [0e0df4b0c5df7fdd1daa5653c255c4737f5526fc]) In ActionView::TestCase::Behavior, assign variables right before rendering the view. - Previously, assigns were locked down the first time view was referenced.
 [#4931 state:resolved] Signed-off-by: José Valim jose.valim@gmail.com 
 http://github.com/rails/rails/commit/0e0df4b0c5df7fdd1daa5653c255c4...
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
Tags
Referenced by
- 
         4931 
          View Test Case _assigns is locked on first reference to _view
        [#4931 state:resolved] 4931 
          View Test Case _assigns is locked on first reference to _view
        [#4931 state:resolved]
 David Chelimsky
      David Chelimsky
 José Valim
      José Valim