From 3a102d052803f7f066e648454297301310d69906 Mon Sep 17 00:00:00 2001 From: Samuel Cochran Date: Thu, 29 Jan 2015 23:00:44 +1100 Subject: Fix flash remaining after last flash deleted Inside a controller functional test after the last flash is deleted it still persists the flash because to_session_value is nil. We should delete it from the session when the serialized version is nil, same as the flash middleware. --- actionpack/lib/action_controller/test_case.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'actionpack/lib/action_controller/test_case.rb') diff --git a/actionpack/lib/action_controller/test_case.rb b/actionpack/lib/action_controller/test_case.rb index d30615fade..10ad80d22c 100644 --- a/actionpack/lib/action_controller/test_case.rb +++ b/actionpack/lib/action_controller/test_case.rb @@ -643,6 +643,8 @@ module ActionController if flash_value = @request.flash.to_session_value @request.session['flash'] = flash_value + else + @request.session.delete('flash') end @response -- cgit v1.2.3