Permalink
Browse files

Add test to access a session after one redirect

  • Loading branch information...
rafaelfranca committed Jun 13, 2012
1 parent 5841aef commit 7d0c946c481d981d031974bc71d98593603bd03d
Showing with 13 additions and 0 deletions.
  1. +13 −0 actionpack/test/dispatch/session/cache_store_test.rb
@@ -31,6 +31,11 @@ def call_reset_session
head :ok
end
+ def redirect_with_session
+ session[:redirect] = 'true'
+ redirect_to '/somewhere'
+ end
+
def rescue_action(e) raise end
end
@@ -103,6 +108,14 @@ def test_setting_session_value_after_session_reset
end
end
+ def test_session_after_redirect
+ with_test_route_set do
+ get '/redirect_with_session'
+ assert_response :redirect
+ assert_equal 'true', @request.session[:redirect]
+ end
+ end
+
def test_getting_session_id
with_test_route_set do
get '/set_session_value'

0 comments on commit 7d0c946

Please sign in to comment.