diff options
author | ddemaree <david@practical.cc> | 2009-01-02 10:31:21 -0600 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-01-02 10:31:21 -0600 |
commit | f90160c6c1ec457f0b4b01c6fef78146271bc070 (patch) | |
tree | 7ba95a6b30cdc0e8fd38a8a63471be526e1a687e | |
parent | a1fb57aa6940253dbed5423ac3e064db272eab2a (diff) | |
download | rails-f90160c6c1ec457f0b4b01c6fef78146271bc070.tar.gz rails-f90160c6c1ec457f0b4b01c6fef78146271bc070.tar.bz2 rails-f90160c6c1ec457f0b4b01c6fef78146271bc070.zip |
Fixed bug where calling app method from console would raise ArgumentError [#1629 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
-rw-r--r-- | actionpack/lib/action_controller/integration.rb | 5 | ||||
-rw-r--r-- | railties/test/console_app_test.rb | 9 |
2 files changed, 11 insertions, 3 deletions
diff --git a/actionpack/lib/action_controller/integration.rb b/actionpack/lib/action_controller/integration.rb index a8e54c2fc7..d9899112c3 100644 --- a/actionpack/lib/action_controller/integration.rb +++ b/actionpack/lib/action_controller/integration.rb @@ -81,8 +81,8 @@ module ActionController end # Create and initialize a new Session instance. - def initialize(app) - @application = app + def initialize(app = nil) + @application = app || ActionController::Dispatcher.new reset! end @@ -591,7 +591,6 @@ EOF # can use this method to open multiple sessions that ought to be tested # simultaneously. def open_session(application = nil) - application ||= ActionController::Dispatcher.new session = Integration::Session.new(application) # delegate the fixture accessors back to the test instance diff --git a/railties/test/console_app_test.rb b/railties/test/console_app_test.rb index cbaf230594..f419fe0d8d 100644 --- a/railties/test/console_app_test.rb +++ b/railties/test/console_app_test.rb @@ -14,6 +14,15 @@ require 'console_app' Test::Unit.run = false class ConsoleAppTest < Test::Unit::TestCase + def test_app_method_should_return_integration_session + assert_nothing_thrown do + console_session = app + assert_not_nil console_session + assert_instance_of ActionController::Integration::Session, + console_session + end + end + uses_mocha 'console reload test' do def test_reload_should_fire_preparation_callbacks a = b = c = nil |