aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_dispatch/middleware/flash.rb2
-rw-r--r--actionpack/test/dispatch/cookies_test.rb6
2 files changed, 4 insertions, 4 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/flash.rb b/actionpack/lib/action_dispatch/middleware/flash.rb
index b5194c675c..027ff7f8ac 100644
--- a/actionpack/lib/action_dispatch/middleware/flash.rb
+++ b/actionpack/lib/action_dispatch/middleware/flash.rb
@@ -149,7 +149,7 @@ module ActionDispatch
#
# Entries set via <tt>now</tt> are accessed the same way as standard entries: <tt>flash['my-key']</tt>.
def now
- FlashNow.new(self)
+ @now ||= FlashNow.new(self)
end
# Keeps either the entire current flash or a specific flash entry available for the next action:
diff --git a/actionpack/test/dispatch/cookies_test.rb b/actionpack/test/dispatch/cookies_test.rb
index 1d06a755b8..ebc16694db 100644
--- a/actionpack/test/dispatch/cookies_test.rb
+++ b/actionpack/test/dispatch/cookies_test.rb
@@ -521,7 +521,7 @@ class CookiesIntegrationTest < ActionDispatch::IntegrationTest
end
end
- def test_setting_cookies_raises_after_stream_back_to_client_even_with_an_empty_flash
+ def test_setting_cookies_raises_after_stream_back_to_client_even_without_cookies
with_test_route_set do
get '/dont_set_cookies'
assert_raise(ActionDispatch::ClosedError) {
@@ -540,7 +540,7 @@ class CookiesIntegrationTest < ActionDispatch::IntegrationTest
end
end
- def test_setting_permanent_cookies_raises_after_stream_back_to_client_even_with_an_empty_flash
+ def test_setting_permanent_cookies_raises_after_stream_back_to_client_even_without_cookies
with_test_route_set do
get '/dont_set_cookies'
assert_raise(ActionDispatch::ClosedError) {
@@ -559,7 +559,7 @@ class CookiesIntegrationTest < ActionDispatch::IntegrationTest
end
end
- def test_setting_signed_cookies_raises_after_stream_back_to_client_even_with_an_empty_flash
+ def test_setting_signed_cookies_raises_after_stream_back_to_client_even_without_cookies
with_test_route_set do
get '/dont_set_cookies'
assert_raise(ActionDispatch::ClosedError) {