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