Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Revert "rack.sessions.options no longer contains :secret in 1.3"

This issue has been fixed in Rack

This reverts commit d0df5fb.
  • Loading branch information...
commit def6fb5a34cbd5ab24fdceb2b9a5cdecfaa473c3 1 parent 6f33e1b
@rkh rkh authored
Showing with 28 additions and 30 deletions.
  1. +28 −30 test/helpers_test.rb
View
58 test/helpers_test.rb
@@ -298,36 +298,34 @@ def test_default
assert_body 'ok'
end
- # # have to write proper tests or remove those, since they no longer work
- # # on Rack 1.3
- # it 'sets a default session secret' do
- # mock_app do
- # enable :sessions
- # get '/' do
- # secret = env['rack.session.options'][:secret]
- # assert secret
- # assert_equal secret, settings.session_secret
- # 'ok'
- # end
- # end
- #
- # get '/'
- # assert_body 'ok'
- # end
- #
- # it 'allows disabling session secret' do
- # mock_app do
- # enable :sessions
- # disable :session_secret
- # get '/' do
- # assert !env['rack.session.options'].include?(:session_secret)
- # 'ok'
- # end
- # end
- #
- # get '/'
- # assert_body 'ok'
- # end
+ it 'sets a default session secret' do
+ mock_app do
+ enable :sessions
+ get '/' do
+ secret = env['rack.session.options'][:secret]
+ assert secret
+ assert_equal secret, settings.session_secret
+ 'ok'
+ end
+ end
+
+ get '/'
+ assert_body 'ok'
+ end
+
+ it 'allows disabling session secret' do
+ mock_app do
+ enable :sessions
+ disable :session_secret
+ get '/' do
+ assert !env['rack.session.options'].include?(:session_secret)
+ 'ok'
+ end
+ end
+
+ get '/'
+ assert_body 'ok'
+ end
it 'accepts an options hash' do
mock_app do
Please sign in to comment.
Something went wrong with that request. Please try again.