Permalink
Browse files

NullSessionHash#destroy should be a no-op

Previously it was raising a NilException
  • Loading branch information...
jbaudanza authored and rafaelfranca committed Sep 19, 2013
1 parent 7061edc commit a21ce2be98d3c4adc50f45c353a4b7e9e77421c1
@@ -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

0 comments on commit a21ce2b

Please sign in to comment.