diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2009-08-31 22:11:50 +0100 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2009-08-31 22:11:50 +0100 |
commit | bae00bb1cc392e1cf408369809b9cf85468bef42 (patch) | |
tree | 17103af6eeb5de96c72beda1debce28950cc7fea /actionpack/test/dispatch/session/cookie_store_test.rb | |
parent | 93c76b2fb08668bc4b8364cc8051476e6d1d15ba (diff) | |
parent | ffd2cf167040b60c26d97c01598560c87bd4b2d3 (diff) | |
download | rails-bae00bb1cc392e1cf408369809b9cf85468bef42.tar.gz rails-bae00bb1cc392e1cf408369809b9cf85468bef42.tar.bz2 rails-bae00bb1cc392e1cf408369809b9cf85468bef42.zip |
Merge commit 'mainstream/master'
Diffstat (limited to 'actionpack/test/dispatch/session/cookie_store_test.rb')
-rw-r--r-- | actionpack/test/dispatch/session/cookie_store_test.rb | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/actionpack/test/dispatch/session/cookie_store_test.rb b/actionpack/test/dispatch/session/cookie_store_test.rb index 2db76818ac..0723a76d2b 100644 --- a/actionpack/test/dispatch/session/cookie_store_test.rb +++ b/actionpack/test/dispatch/session/cookie_store_test.rb @@ -8,10 +8,6 @@ class CookieStoreTest < ActionController::IntegrationTest # Make sure Session middleware doesnt get included in the middleware stack ActionController::Base.session_store = nil - DispatcherApp = ActionController::Dispatcher.new - CookieStoreApp = ActionDispatch::Session::CookieStore.new(DispatcherApp, - :key => SessionKey, :secret => SessionSecret) - Verifier = ActiveSupport::MessageVerifier.new(SessionSecret, 'SHA1') SignedBar = Verifier.generate(:foo => "bar", :session_id => ActiveSupport::SecureRandom.hex(16)) @@ -51,7 +47,7 @@ class CookieStoreTest < ActionController::IntegrationTest end def setup - @integration_session = open_session(CookieStoreApp) + reset_app! end def test_raises_argument_error_if_missing_session_key @@ -197,10 +193,10 @@ class CookieStoreTest < ActionController::IntegrationTest end def test_session_store_with_expire_after - app = ActionDispatch::Session::CookieStore.new(DispatcherApp, :key => SessionKey, :secret => SessionSecret, :expire_after => 5.hours) - @integration_session = open_session(app) - with_test_route_set do + app = ActionDispatch::Session::CookieStore.new(ActionController::Dispatcher.new, :key => SessionKey, :secret => SessionSecret, :expire_after => 5.hours) + @integration_session = open_session(app) + # First request accesses the session time = Time.local(2008, 4, 24) Time.stubs(:now).returns(time) @@ -230,6 +226,12 @@ class CookieStoreTest < ActionController::IntegrationTest end private + def reset_app! + app = ActionDispatch::Session::CookieStore.new(ActionController::Dispatcher.new, + :key => SessionKey, :secret => SessionSecret) + @integration_session = open_session(app) + end + def with_test_route_set with_routing do |set| set.draw do |map| @@ -237,6 +239,7 @@ class CookieStoreTest < ActionController::IntegrationTest c.connect "/:action" end end + reset_app! yield end end |