diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-06-13 11:24:03 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-06-13 11:24:03 -0300 |
commit | 0bfdf4087047cf7ef72fa10d07baecadefc53b70 (patch) | |
tree | 51ee86c0573fc02a5a46f90ee8cbb57a8944854d /actionpack/lib/action_controller | |
parent | b71d46a81a5798ea4e5ba0f7d41e07f573e6e615 (diff) | |
parent | be46586e691e28f3937666c3fff037eef22406de (diff) | |
download | rails-0bfdf4087047cf7ef72fa10d07baecadefc53b70.tar.gz rails-0bfdf4087047cf7ef72fa10d07baecadefc53b70.tar.bz2 rails-0bfdf4087047cf7ef72fa10d07baecadefc53b70.zip |
Merge pull request #15682 from tgxworld/controller_test_process
Set flash in test session when necessary.
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r-- | actionpack/lib/action_controller/test_case.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/test_case.rb b/actionpack/lib/action_controller/test_case.rb index e6695ffc90..849286a4a9 100644 --- a/actionpack/lib/action_controller/test_case.rb +++ b/actionpack/lib/action_controller/test_case.rb @@ -629,8 +629,11 @@ module ActionController @response.prepare! @assigns = @controller.respond_to?(:view_assigns) ? @controller.view_assigns : {} - @request.session['flash'] = @request.flash.to_session_value - @request.session.delete('flash') if @request.session['flash'].blank? + + if flash_value = @request.flash.to_session_value + @request.session['flash'] = flash_value + end + @response end |