instance method
open_session
Ruby on Rails 4.0.13
Since v3.0.20Signature
open_session(app = nil)
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.
Parameters
-
appopt = nil
Source
# File actionpack/lib/action_dispatch/testing/integration.rb, line 361
def open_session(app = nil)
dup.tap do |session|
yield session if block_given?
end
end
Defined in actionpack/lib/action_dispatch/testing/integration.rb line 361
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionDispatch::Integration::Runner