Module: RSpec::Rails::ViewAssigns
- Included in:
- HelperExampleGroup, ViewExampleGroup
- Defined in:
- lib/rspec/rails/view_assigns.rb
Overview
Helpers for making instance variables available to views.
Instance Method Summary collapse
-
#assign(key, value) ⇒ Object
Assigns a value to an instance variable in the scope of the view being rendered.
-
#view_assigns ⇒ Object
Compat-shim for AbstractController::Rendering#view_assigns.
Instance Method Details
#assign(key, value) ⇒ Object
Assigns a value to an instance variable in the scope of the view being rendered.
11 12 13 |
# File 'lib/rspec/rails/view_assigns.rb', line 11 def assign(key, value) _encapsulated_assigns[key] = value end |
#view_assigns ⇒ Object
Compat-shim for AbstractController::Rendering#view_assigns
16 17 18 |
# File 'lib/rspec/rails/view_assigns.rb', line 16 def view_assigns super.merge(_encapsulated_assigns) end |