diff options
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/test/controller/flash_test.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/actionpack/test/controller/flash_test.rb b/actionpack/test/controller/flash_test.rb index d497913dc4..ea4563afa1 100644 --- a/actionpack/test/controller/flash_test.rb +++ b/actionpack/test/controller/flash_test.rb @@ -231,6 +231,10 @@ class FlashIntegrationTest < ActionDispatch::IntegrationTest def use_flash render :inline => "flash: #{flash["that"]}" end + + def redirect_without_flash + redirect_to '/somewhere' + end end def test_flash @@ -245,6 +249,22 @@ class FlashIntegrationTest < ActionDispatch::IntegrationTest end end + def test_redirect + with_test_route_set do + get '/set_flash' + assert_response :success + assert_equal "hello", @request.flash["that"] + + get '/redirect_without_flash' + assert_response :redirect + assert_equal "hello", @request.flash["that"] + + get '/redirect_without_flash' + assert_response :redirect + assert_equal nil, @request.flash["that"] + end + end + def test_just_using_flash_does_not_stream_a_cookie_back with_test_route_set do get '/use_flash' |