提交 cb8174c5 编写于 作者: J José Valim

Merge pull request #12279 from jbaudanza/reset_session

Calling reset_session inside of a controller with a NullSessionHash raises a nil exception.
......@@ -124,6 +124,9 @@ def initialize(env)
@loaded = true
end
# no-op
def destroy; end
def exists?
true
end
......
......@@ -78,6 +78,11 @@ def encrypted
cookies.encrypted[:foo] = 'bar'
render :nothing => true
end
def try_to_reset_session
reset_session
render :nothing => true
end
end
class FreeCookieController < RequestForgeryProtectionControllerUsingResetSession
......@@ -320,6 +325,11 @@ def setup
post :encrypted
assert_response :ok
end
test 'should allow reset_session' do
post :try_to_reset_session
assert_response :ok
end
end
class RequestForgeryProtectionControllerUsingExceptionTest < ActionController::TestCase
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册