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

Ensure calling reset session twice does not raise errors.

上级 8796f9a3
......@@ -23,6 +23,7 @@ def get_session_id
def call_reset_session
session[:foo]
reset_session
reset_session if params[:twice]
session[:foo] = "baz"
head :ok
end
......@@ -94,6 +95,17 @@ def test_getting_nil_session_value
end
end
def test_calling_reset_session_twice_does_not_raise_errors
with_test_route_set do
get '/call_reset_session', :twice => "true"
assert_response :success
get '/get_session_value'
assert_response :success
assert_equal 'foo: "baz"', response.body
end
end
def test_setting_session_value_after_session_reset
with_test_route_set do
get '/set_session_value'
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册