aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2016-05-06 15:05:25 -0500
committerRafael Mendonça França <rafaelmfranca@gmail.com>2016-05-06 15:12:31 -0500
commitbf876aa0b61995f1be9b0146df7db74bd34d46af (patch)
treee4db393cf484b05b0940e38396b82b1e596dc268 /actionpack/test
parentde8f3cb483e5821dc02e674c9ef176fc9159da26 (diff)
downloadrails-bf876aa0b61995f1be9b0146df7db74bd34d46af.tar.gz
rails-bf876aa0b61995f1be9b0146df7db74bd34d46af.tar.bz2
rails-bf876aa0b61995f1be9b0146df7db74bd34d46af.zip
Make flash messages cookie compatible with Rails 4
In #18721 we removed the discard key from the session hash used to flash messages and that broke compatibility with Rails 4 applications because they try to map in the discarded flash messages and it returns nil. Fixes #24726.
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/controller/flash_hash_test.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/test/controller/flash_hash_test.rb b/actionpack/test/controller/flash_hash_test.rb
index 081288ef21..f87077dd86 100644
--- a/actionpack/test/controller/flash_hash_test.rb
+++ b/actionpack/test/controller/flash_hash_test.rb
@@ -57,10 +57,10 @@ module ActionDispatch
def test_to_session_value
@hash['foo'] = 'bar'
- assert_equal({'flashes' => {'foo' => 'bar'}}, @hash.to_session_value)
+ assert_equal({ 'discard' => [], 'flashes' => { 'foo' => 'bar' } }, @hash.to_session_value)
@hash.now['qux'] = 1
- assert_equal({'flashes' => {'foo' => 'bar'}}, @hash.to_session_value)
+ assert_equal({ 'flashes' => { 'foo' => 'bar' }, 'discard' => [] }, @hash.to_session_value)
@hash.discard('foo')
assert_equal(nil, @hash.to_session_value)