diff options
author | Anil Wadghule <anildigital@gmail.com> | 2010-05-15 20:18:31 +0530 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-05-15 16:52:23 +0200 |
commit | 2d84f24af5cb0854a316929fa0d0720773be2162 (patch) | |
tree | 5e74e0632a0f3bad5244cd4748351f7ccfcec9b1 /actionpack/test | |
parent | e807476d31fd15fbf8808d739b0afada4faeece9 (diff) | |
download | rails-2d84f24af5cb0854a316929fa0d0720773be2162.tar.gz rails-2d84f24af5cb0854a316929fa0d0720773be2162.tar.bz2 rails-2d84f24af5cb0854a316929fa0d0720773be2162.zip |
Add tests for convenience methods #notice and #alert to flash.now [#4369 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'actionpack/test')
-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 3c651ebebc..c662ce264b 100644 --- a/actionpack/test/controller/flash_test.rb +++ b/actionpack/test/controller/flash_test.rb @@ -81,6 +81,16 @@ class FlashTest < ActionController::TestCase redirect_to '/somewhere', :notice => "Good luck in the somewheres!" end + def render_with_flash_now_alert + flash.now.alert = "Beware the nowheres now!" + render :inline => "hello" + end + + def render_with_flash_now_notice + flash.now.notice = "Good luck in the somewheres now!" + render :inline => "hello" + end + def redirect_with_other_flashes redirect_to '/wonderland', :flash => { :joyride => "Horses!" } end @@ -183,6 +193,16 @@ class FlashTest < ActionController::TestCase assert_equal "Good luck in the somewheres!", @controller.send(:flash)[:notice] end + def test_render_with_flash_now_alert + get :render_with_flash_now_alert + assert_equal "Beware the nowheres now!", @controller.send(:flash)[:alert] + end + + def test_render_with_flash_now_notice + get :render_with_flash_now_notice + assert_equal "Good luck in the somewheres now!", @controller.send(:flash)[:notice] + end + def test_redirect_to_with_other_flashes get :redirect_with_other_flashes assert_equal "Horses!", @controller.send(:flash)[:joyride] |