From f7cde3eb2231f31764739a9abdf2610dd2721fe8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Sun, 3 Jun 2012 15:11:45 -0300 Subject: Add test to flash sweep after two redirects This test is needed to avoid regressions in the way that flash works now (swept in every request). --- actionpack/test/controller/flash_test.rb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) 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' -- cgit v1.2.3