Class | Test::Rails::FunctionalTestCase |
In: |
lib/test/rails/functional_test_case.rb
|
Parent: | Test::Rails::TestCase |
FunctionalTestCase is an abstract class that sets up a controller instance for its subclasses.
flash | [R] |
Flash accessor. The flash can be assigned to before calling process or
render and it will Just Work (yay!)
view: <div class="error"><%= flash[:error] %></div> test: flash[:error] = 'You did a bad thing.' render assert_tag :tag => 'div', :attributes => { :class => 'error' }, :content => 'You did a bad thing.' |
session | [R] |
Session accessor. The session can be assigned to before calling process or
render and it will Just Work (yay!)
test: def test_logout session[:user] = users(:herbert) post :logout assert_equal nil, session[:user] end |
Sets up instance variables to allow tests depending on a controller work.
setup uses the instance variable @controller_class_name to determine which controller class to instantiate.
setup also instantiates a new @request and @response object.
If you need to perform extra setup actions, define setup_extra and FunctionalTestCase will call it after performing the rest of its setup actions.