Method: ActionDispatch::Integration::Runner#open_session

Defined in:
actionpack/lib/action_dispatch/testing/integration.rb

#open_sessionObject

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.



404
405
406
407
408
409
410
# File 'actionpack/lib/action_dispatch/testing/integration.rb', line 404

def open_session
  dup.tap do |session|
    session.reset!
    session.root_session = self.root_session || self
    yield session if block_given?
  end
end