From acfeec515111d427b3a27aef3af034922e0d9248 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Sat, 26 Sep 2009 20:51:05 -0500 Subject: Allow integration test rack app to be set with "@app" ivar instead of using open_session --- actionpack/test/dispatch/session/cookie_store_test.rb | 4 ++-- actionpack/test/dispatch/session/mem_cache_store_test.rb | 6 +++--- actionpack/test/dispatch/show_exceptions_test.rb | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) (limited to 'actionpack/test/dispatch') diff --git a/actionpack/test/dispatch/session/cookie_store_test.rb b/actionpack/test/dispatch/session/cookie_store_test.rb index bc0b4b22a5..6241c79829 100644 --- a/actionpack/test/dispatch/session/cookie_store_test.rb +++ b/actionpack/test/dispatch/session/cookie_store_test.rb @@ -222,8 +222,8 @@ class CookieStoreTest < ActionController::IntegrationTest map.connect "/:action", :controller => "cookie_store_test/test" end options = {:key => SessionKey, :secret => SessionSecret}.merge(options) - app = ActionDispatch::Session::CookieStore.new(set, options) - @integration_session = open_session(app) + @app = ActionDispatch::Session::CookieStore.new(set, options) + reset! yield end end diff --git a/actionpack/test/dispatch/session/mem_cache_store_test.rb b/actionpack/test/dispatch/session/mem_cache_store_test.rb index 4c6a80fdb8..c2d40ae24a 100644 --- a/actionpack/test/dispatch/session/mem_cache_store_test.rb +++ b/actionpack/test/dispatch/session/mem_cache_store_test.rb @@ -101,7 +101,7 @@ class MemCacheStoreTest < ActionController::IntegrationTest get '/set_session_value', :_session_id => session_id assert_response :success - assert_equal nil, cookies['_session_id'] + assert_not_equal session_id, cookies['_session_id'] end end rescue LoadError, RuntimeError @@ -114,8 +114,8 @@ class MemCacheStoreTest < ActionController::IntegrationTest set.draw do |map| map.connect "/:action", :controller => "mem_cache_store_test/test" end - app = ActionDispatch::Session::MemCacheStore.new(set, :key => '_session_id') - @integration_session = open_session(app) + @app = ActionDispatch::Session::MemCacheStore.new(set, :key => '_session_id') + reset! yield end end diff --git a/actionpack/test/dispatch/show_exceptions_test.rb b/actionpack/test/dispatch/show_exceptions_test.rb index d4800e4edb..9f6a93756c 100644 --- a/actionpack/test/dispatch/show_exceptions_test.rb +++ b/actionpack/test/dispatch/show_exceptions_test.rb @@ -35,7 +35,7 @@ class ShowExceptionsTest < ActionController::IntegrationTest DevelopmentApp = ActionDispatch::ShowExceptions.new(Boomer, true) test "rescue in public from a remote ip" do - @integration_session = open_session(ProductionApp) + @app = ProductionApp self.remote_addr = '208.77.188.166' get "/" @@ -52,7 +52,7 @@ class ShowExceptionsTest < ActionController::IntegrationTest end test "rescue locally from a local request" do - @integration_session = open_session(ProductionApp) + @app = ProductionApp self.remote_addr = '127.0.0.1' get "/" @@ -73,7 +73,7 @@ class ShowExceptionsTest < ActionController::IntegrationTest old_locale, I18n.locale = I18n.locale, :da begin - @integration_session = open_session(ProductionApp) + @app = ProductionApp self.remote_addr = '208.77.188.166' get "/" @@ -89,7 +89,7 @@ class ShowExceptionsTest < ActionController::IntegrationTest end test "always rescue locally in development mode" do - @integration_session = open_session(DevelopmentApp) + @app = DevelopmentApp self.remote_addr = '208.77.188.166' get "/" -- cgit v1.2.3