Module: RSpec::Rails::ViewAssigns
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Included In:
| |
Defined in: | rspec-rails/lib/rspec/rails/view_assigns.rb |
Overview
Helpers for making instance variables available to views.
Instance Method Summary
-
#assign(key, value)
Assigns a value to an instance variable in the scope of the view being rendered.
-
#view_assigns
Compat-shim for AbstractController::Rendering#view_assigns.
- #_encapsulated_assigns private
Instance Method Details
#_encapsulated_assigns (private)
[ GitHub ]# File 'rspec-rails/lib/rspec/rails/view_assigns.rb', line 22
def _encapsulated_assigns @_encapsulated_assigns ||= {} end
#assign(key, value)
Assigns a value to an instance variable in the scope of the view being rendered.
# File 'rspec-rails/lib/rspec/rails/view_assigns.rb', line 11
def assign(key, value) _encapsulated_assigns[key] = value end
#view_assigns
Compat-shim for AbstractController::Rendering#view_assigns
# File 'rspec-rails/lib/rspec/rails/view_assigns.rb', line 16
def view_assigns super.merge(_encapsulated_assigns) end