Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

View Test Case _assigns is locked on first reference to _view

#4931

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.

Reported by David Chelimsky · June 22nd, 2010 @ 04:15 PM

State: resolved
Milestone: none
Assigned to: José Valim José Valim
Importance: none

Activity

  1. David Chelimsky
  2. Repository
    Repository
    • 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...

    June 23rd, 2010 @ 02:07 PM