Module: Rails::Controller::Testing::TestProcess

Defined in:
lib/rails/controller/testing/test_process.rb

Instance Method Summary collapse

Instance Method Details

#assigns(key = nil) ⇒ Object


7
8
9
10
11
# File 'lib/rails/controller/testing/test_process.rb', line 7

def assigns(key = nil)
  assigns = {}.with_indifferent_access
  @controller.view_assigns.each { |k, v| assigns.regular_writer(k, v) }
  key.nil? ? assigns : assigns[key]
end