diff options
author | Joshua Peek <josh@joshpeek.com> | 2009-04-26 14:33:57 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-04-26 14:33:57 -0500 |
commit | 04949096797a390105c7ab9fb9b99938d5921dd4 (patch) | |
tree | 16316242f307d2f7a41189720ff10ebf44770b50 /actionpack/test/controller | |
parent | c8919f4c7ca13ad78987ea0c8497abe85249975b (diff) | |
download | rails-04949096797a390105c7ab9fb9b99938d5921dd4.tar.gz rails-04949096797a390105c7ab9fb9b99938d5921dd4.tar.bz2 rails-04949096797a390105c7ab9fb9b99938d5921dd4.zip |
Inherit TestSession from Session::AbstractStore and add indifferent access to Session::AbstractStore.
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r-- | actionpack/test/controller/http_digest_authentication_test.rb | 2 | ||||
-rw-r--r-- | actionpack/test/controller/request/test_request_test.rb | 23 |
2 files changed, 12 insertions, 13 deletions
diff --git a/actionpack/test/controller/http_digest_authentication_test.rb b/actionpack/test/controller/http_digest_authentication_test.rb index 00789eea38..7bebc8cd2a 100644 --- a/actionpack/test/controller/http_digest_authentication_test.rb +++ b/actionpack/test/controller/http_digest_authentication_test.rb @@ -111,8 +111,6 @@ class HttpDigestAuthenticationTest < ActionController::TestCase test "authentication request with valid credential and nil session" do @request.env['HTTP_AUTHORIZATION'] = encode_credentials(:username => 'pretty', :password => 'please') - # session_id = "" in functional test, but is +nil+ in real life - @request.session.session_id = nil get :display assert_response :success diff --git a/actionpack/test/controller/request/test_request_test.rb b/actionpack/test/controller/request/test_request_test.rb index 81551b4ba7..0a39feb7fe 100644 --- a/actionpack/test/controller/request/test_request_test.rb +++ b/actionpack/test/controller/request/test_request_test.rb @@ -10,26 +10,27 @@ class ActionController::TestRequestTest < ActiveSupport::TestCase def test_test_request_has_session_options_initialized assert @request.session_options end - - Rack::Session::Abstract::ID::DEFAULT_OPTIONS.each_key do |option| - test "test_rack_default_session_options_#{option}_exists_in_session_options_and_is_default" do - assert_equal(Rack::Session::Abstract::ID::DEFAULT_OPTIONS[option], - @request.session_options[option], + + ActionDispatch::Session::AbstractStore::DEFAULT_OPTIONS.each_key do |option| + test "rack default session options #{option} exists in session options and is default" do + assert_equal(ActionDispatch::Session::AbstractStore::DEFAULT_OPTIONS[option], + @request.session_options[option], "Missing rack session default option #{option} in request.session_options") end - test "test_rack_default_session_options_#{option}_exists_in_session_options" do - assert(@request.session_options.has_key?(option), + + test "rack default session options #{option} exists in session options" do + assert(@request.session_options.has_key?(option), "Missing rack session option #{option} in request.session_options") end end - + def test_session_id_exists_by_default assert_not_nil(@request.session_options[:id]) end - + def test_session_id_different_on_each_call - prev_id = + prev_id = assert_not_equal(@request.session_options[:id], ActionController::TestRequest.new.session_options[:id]) end - + end
\ No newline at end of file |