diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-06-03 15:11:45 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-06-05 16:05:49 -0300 |
commit | f7cde3eb2231f31764739a9abdf2610dd2721fe8 (patch) | |
tree | 81940b7bb5afc3891a82888c78865f9b6d99ec9a /actionpack/test/controller | |
parent | 634755410991419bab9048f81279bd6a48d7f6b4 (diff) | |
download | rails-f7cde3eb2231f31764739a9abdf2610dd2721fe8.tar.gz rails-f7cde3eb2231f31764739a9abdf2610dd2721fe8.tar.bz2 rails-f7cde3eb2231f31764739a9abdf2610dd2721fe8.zip |
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).
Diffstat (limited to 'actionpack/test/controller')
-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' |