Method: ActionDispatch::Integration::Runner#open_session
- Defined in:
- actionpack/lib/action_dispatch/testing/integration.rb
#open_session ⇒ Object
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.
394 395 396 397 398 399 400 |
# File 'actionpack/lib/action_dispatch/testing/integration.rb', line 394 def open_session dup.tap do |session| session.reset! session.root_session = self.root_session || self yield session if block_given? end end |