Permalink
Browse files

Merge pull request #12279 from jbaudanza/reset_session

Calling reset_session inside of a controller with a NullSessionHash raises a nil exception.
  • Loading branch information...
2 parents 1ea4a89 + 0f3124d commit cb8174c57f46f3b11bc4662638539f45677d7dc1 @josevalim josevalim committed Sep 19, 2013
@@ -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 cb8174c

Please sign in to comment.