提交 04d9e94e 编写于 作者: R Rick Olson

Fixed that you can still access the flash after the flash has been reset in...

Fixed that you can still access the flash after the flash has been reset in reset_session.  Closes #5584 [lmarlow@yahoo.com]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4617 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 3a0159dd
*SVN*
* Fixed that you can still access the flash after the flash has been reset in reset_session. Closes #5584 [lmarlow@yahoo.com]
* Allow form_for and fields_for to work with indexed form inputs. [Jeremy Kemper, Matt Lyon]
<% form_for 'post[]', @post do |f| -%>
......
......@@ -147,7 +147,8 @@ def process_cleanup_with_flash
def reset_session_with_flash
reset_session_without_flash
@flash = nil
remove_instance_variable(:@flash)
flash(:refresh)
end
protected
......
......@@ -35,6 +35,16 @@ def use_flash_and_keep_it
render :inline => "hello"
end
def use_flash_after_reset_session
flash["that"] = "hello"
@flashy_that = flash["that"]
reset_session
@flashy_that_reset = flash["that"]
flash["this"] = "good-bye"
@flashy_this = flash["this"]
render :inline => "hello"
end
def rescue_action(e)
raise unless ActionController::MissingTemplate === e
end
......@@ -82,4 +92,11 @@ def test_flash_now
assert_nil @response.template.assigns["flash_copy"]["foo"]
assert_nil @response.template.assigns["flashy"]
end
def test_flash_after_reset_session
get :use_flash_after_reset_session
assert_equal "hello", @response.template.assigns["flashy_that"]
assert_equal "good-bye", @response.template.assigns["flashy_this"]
assert_nil @response.template.assigns["flashy_that_reset"]
end
end
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册