diff options
author | Joshua Peek <josh@joshpeek.com> | 2009-09-26 20:51:05 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-09-26 20:51:05 -0500 |
commit | acfeec515111d427b3a27aef3af034922e0d9248 (patch) | |
tree | 33e1ea90436ab5dc58fe8c2da4e3735696911e72 /actionpack/lib/action_dispatch | |
parent | 02413baabbc2d7458377822974ee3405a91fe627 (diff) | |
download | rails-acfeec515111d427b3a27aef3af034922e0d9248.tar.gz rails-acfeec515111d427b3a27aef3af034922e0d9248.tar.bz2 rails-acfeec515111d427b3a27aef3af034922e0d9248.zip |
Allow integration test rack app to be set with "@app" ivar instead of using open_session
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r-- | actionpack/lib/action_dispatch/testing/integration.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/testing/integration.rb b/actionpack/lib/action_dispatch/testing/integration.rb index f344c1b572..4c0d4455f9 100644 --- a/actionpack/lib/action_dispatch/testing/integration.rb +++ b/actionpack/lib/action_dispatch/testing/integration.rb @@ -168,8 +168,8 @@ module ActionDispatch attr_accessor :request_count # Create and initialize a new Session instance. - def initialize(app = nil) - @app = app || ActionController::Dispatcher.new + def initialize(app) + @app = app reset! end @@ -354,6 +354,7 @@ module ActionDispatch # can use this method to open multiple sessions that ought to be tested # simultaneously. def open_session(app = nil) + app ||= @app ||= ActionController::Dispatcher.new session = Integration::Session.new(app) # delegate the fixture accessors back to the test instance |