Skip to content

Commit

Permalink
Add test to access a session after one redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelfranca committed Jun 13, 2012
1 parent 5841aef commit 7d0c946
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions actionpack/test/dispatch/session/cache_store_test.rb
Expand Up @@ -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

Expand Down Expand Up @@ -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'
Expand Down

0 comments on commit 7d0c946

Please sign in to comment.