Methods
Public Class methods
new(*args)
     # File actionpack/lib/action_controller/integration.rb, line 500
500:       def initialize(*args)
501:         super
502:         @integration_session = nil
503:       end
Public Instance methods
method_missing(sym, *args, &block)

Delegate unhandled messages to the current session instance.

     # File actionpack/lib/action_controller/integration.rb, line 570
570:       def method_missing(sym, *args, &block)
571:         reset! unless @integration_session
572:         if @integration_session.respond_to?(sym)
573:           @integration_session.__send__(sym, *args, &block).tap do
574:             copy_session_variables!
575:           end
576:         else
577:           super
578:         end
579:       end
open_session(application = nil) {|session if block_given?| ...}

Open a new session instance. If a block is given, the new session is yielded to the block before being returned.

  session = open_session do |sess|
    sess.extend(CustomAssertions)
  end

By default, a single session is automatically created for you, but you can use this method to open multiple sessions that ought to be tested simultaneously.

     # File actionpack/lib/action_controller/integration.rb, line 533
533:       def open_session(application = nil)
534:         session = Integration::Session.new(application)
535: 
536:         # delegate the fixture accessors back to the test instance
537:         extras = Module.new { attr_accessor :delegate, :test_result }
538:         if self.class.respond_to?(:fixture_table_names)
539:           self.class.fixture_table_names.each do |table_name|
540:             name = table_name.tr(".", "_")
541:             next unless respond_to?(name, true)
542:             extras.__send__(:define_method, name) { |*args|
543:               delegate.send(name, *args)
544:             }
545:           end
546:         end
547: 
548:         # delegate add_assertion to the test case
549:         extras.__send__(:define_method, :add_assertion) {
550:           test_result.add_assertion
551:         }
552:         session.extend(extras)
553:         session.delegate = self
554:         session.test_result = @_result
555: 
556:         yield session if block_given?
557:         session
558:       end
reset!()

Reset the current session. This is useful for testing multiple sessions in a single test case.

     # File actionpack/lib/action_controller/integration.rb, line 507
507:       def reset!
508:         @integration_session = open_session
509:       end