diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2005-10-20 21:59:48 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2005-10-20 21:59:48 +0000 |
commit | 22d9bad8a038eef751e1270f204211cca3c8af18 (patch) | |
tree | 27064e135142b4f49f27b242ab98b409fe551e38 /actionpack/test | |
parent | 5f0b9369cc857ef007a9b0f573b63225e342e4fd (diff) | |
download | rails-22d9bad8a038eef751e1270f204211cca3c8af18.tar.gz rails-22d9bad8a038eef751e1270f204211cca3c8af18.tar.bz2 rails-22d9bad8a038eef751e1270f204211cca3c8af18.zip |
Expose the session model backing CGI::Session
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2696 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/active_record_store_test.rb | 16 | ||||
-rw-r--r-- | actionpack/test/controller/base_test.rb | 8 |
2 files changed, 17 insertions, 7 deletions
diff --git a/actionpack/test/controller/active_record_store_test.rb b/actionpack/test/controller/active_record_store_test.rb index be7f911e70..f10bbf7434 100644 --- a/actionpack/test/controller/active_record_store_test.rb +++ b/actionpack/test/controller/active_record_store_test.rb @@ -53,7 +53,6 @@ module CommonActiveRecordStoreTests @new_session.close end end - end class ActiveRecordStoreTest < Test::Unit::TestCase @@ -73,13 +72,17 @@ class ActiveRecordStoreTest < Test::Unit::TestCase @new_session['foo'] = 'bar' end + def test_model_attribute + assert_kind_of CGI::Session::ActiveRecordStore::Session, @new_session.model + assert_equal @new_session.model.data, @new_session.data + end + def teardown session_class.drop_table! end end class ColumnLimitTest < Test::Unit::TestCase - def setup @session_class = CGI::Session::ActiveRecordStore::Session @session_class.create_table! @@ -97,10 +100,8 @@ class ColumnLimitTest < Test::Unit::TestCase s.data assert_raises(ActionController::SessionOverflowError) { s.save } end - end - class DeprecatedActiveRecordStoreTest < ActiveRecordStoreTest def setup session_class.connection.execute 'create table old_sessions (id integer primary key, sessid text unique, data text)' @@ -128,12 +129,17 @@ class SqlBypassActiveRecordStoreTest < ActiveRecordStoreTest end @session_class end + + def test_model_attribute + assert_kind_of CGI::Session::ActiveRecordStore::SqlBypass, @new_session.model + assert_equal @new_session.model.data, @new_session.data + end end # End of safety net. rescue Object => e - $stderr.puts "Skipping CGI::Session::ActiveRecordStore tests: #{e}" + $stderr.puts "Skipping CGI::Session::ActiveRecordStore tests: #{e}" #$stderr.puts " #{e.backtrace.join("\n ")}" end end diff --git a/actionpack/test/controller/base_test.rb b/actionpack/test/controller/base_test.rb index 664c4de93b..9687aa2748 100644 --- a/actionpack/test/controller/base_test.rb +++ b/actionpack/test/controller/base_test.rb @@ -67,7 +67,11 @@ class ControllerInstanceTests < Test::Unit::TestCase end def test_action_methods - @empty_controllers.each {|c| assert_equal({}, c.send(:action_methods), "#{c.class.controller_path} should be empty!")} - @non_empty_controllers.each {|c| assert_equal({"public_action"=>true}, c.send(:action_methods), "#{c.class.controller_path} should not be empty!")} + @empty_controllers.each do |c| + assert_equal Set.new, c.send(:action_methods), "#{c.class.controller_path} should be empty!" + end + @non_empty_controllers.each do |c| + assert_equal Set.new('public_action'), c.send(:action_methods), "#{c.class.controller_path} should not be empty!" + end end end |