module ActionDispatch::Integration::Runner

def app

def app
  @app
end

def copy_session_variables! #:nodoc:

:nodoc:
test instance.
Copy the instance variables from the current session instance into the
def copy_session_variables! #:nodoc:
  return unless @integration_session
  %w(controller response request).each do |var|
    instance_variable_set("@#{var}", @integration_session.__send__(var))
  end
end

def method_missing(sym, *args, &block)

Delegate unhandled messages to the current session instance.
def method_missing(sym, *args, &block)
  reset! unless @integration_session
  if @integration_session.respond_to?(sym)
    @integration_session.__send__(sym, *args, &block).tap do
      copy_session_variables!
    end
  else
    super
  end
end

def open_session(app = nil)

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

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

yielded to the block before being returned.
Open a new session instance. If a block is given, the new session is
def open_session(app = nil)
  dup.tap do |session|
    yield session if block_given?
  end
end

def reset!

in a single test case.
Reset the current session. This is useful for testing multiple sessions
def reset!
  @integration_session = Integration::Session.new(app)
end

def url_options

def url_options
  reset! unless @integration_session
  @integration_session.url_options
end