Methods
Included Modules
Public Instance methods
[ show source ]
# File actionpack/lib/action_dispatch/testing/integration.rb, line 309 def app @app end
Delegate unhandled messages to the current session instance.
[ show source ]
# File actionpack/lib/action_dispatch/testing/integration.rb, line 365 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
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.
[ show source ]
# File actionpack/lib/action_dispatch/testing/integration.rb, line 341 def open_session(app = nil) dup.tap do |session| yield session if block_given? end end
Reset the current session. This is useful for testing multiple sessions in a single test case.
[ show source ]
# File actionpack/lib/action_dispatch/testing/integration.rb, line 315 def reset! @integration_session = Integration::Session.new(app) end
[ show source ]
# File actionpack/lib/action_dispatch/testing/integration.rb, line 359 def url_options reset! unless @integration_session @integration_session.url_options end