module ActionDispatch::Integration::Runner
def app
def app @app ||= nil end
def copy_session_variables! #:nodoc:
test instance.
Copy the instance variables from the current session instance into the
def copy_session_variables! #:nodoc: return unless integration_session %w(controller response request).each do |var| instance_variable_set("@#{var}", @integration_session.__send__(var)) end end
def default_url_options
def default_url_options reset! unless integration_session integration_session.default_url_options end
def default_url_options=(options)
def default_url_options=(options) reset! unless integration_session integration_session.default_url_options = options end
def integration_session
def integration_session @integration_session ||= nil end
def method_missing(sym, *args, &block)
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
def open_session(app = nil)
can use this method to open multiple sessions that ought to be tested
By default, a single session is automatically created for you, but you
end
sess.extend(CustomAssertions)
session = open_session do |sess|
yielded to the block before being returned.
Open a new session instance. If a block is given, the new session is
def open_session(app = nil) dup.tap do |session| yield session if block_given? end end
def reset!
Reset the current session. This is useful for testing multiple sessions
def reset! @integration_session = Integration::Session.new(app) end
def respond_to?(method, include_private = false)
def respond_to?(method, include_private = false) integration_session.respond_to?(method, include_private) || super end