module RSpec::Rails::ViewAssigns

def _assigns

Other tags:
    Private: -
def _assigns
  super.merge(_encapsulated_assigns)
end

def _encapsulated_assigns

def _encapsulated_assigns
  @_encapsulated_assigns ||= {}
end

def assign(key, value)

assign(:widget, stub_model(Widget))

@example

view being rendered.
Assigns a value to an instance variable in the scope of the
def assign(key, value)
  _encapsulated_assigns[key] = value
end

def view_assigns

interpreted, as it was before commit dd0095.
that checks for the Rails version when the module is being
Once that change _is_ released, this can be changed to something

knowing anything about the Rails version we are dealing with.
security fix), this bit ensures that we do the right thing without
would have been in 3.0.1, but 3.0.1 bypassed this change for a
the _assigns/view_assigns patch will be released (I thought it
Rails-3.0.0 was released. Since we are not able to predict when
_assigns was deprecated in favor of view_assigns after

Compat-shim for AbstractController::Rendering#view_assigns
def view_assigns
  super.merge(_encapsulated_assigns)
rescue
  _assigns
end