diff options
author | Prem Sichanugrist <s@sikachu.com> | 2012-08-15 01:22:50 -0400 |
---|---|---|
committer | Prem Sichanugrist <s@sikachu.com> | 2012-08-24 15:24:19 -0400 |
commit | 0ffe19056c8e8b2f9ae9d487b896cad2ce9387ad (patch) | |
tree | 8308e637c41e0f0bed0ffdb6b1fe96b741825f53 /railties/test | |
parent | 2c571b3f0544a6457db4818e752f4cd4bacd48b4 (diff) | |
download | rails-0ffe19056c8e8b2f9ae9d487b896cad2ce9387ad.tar.gz rails-0ffe19056c8e8b2f9ae9d487b896cad2ce9387ad.tar.bz2 rails-0ffe19056c8e8b2f9ae9d487b896cad2ce9387ad.zip |
Extract ActiveRecord::SessionStore from Rails
This functionality will be available from gem
`active_record-session_store` instead.
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/application/initializers/frameworks_test.rb | 20 | ||||
-rw-r--r-- | railties/test/generators/session_migration_generator_test.rb | 27 |
2 files changed, 0 insertions, 47 deletions
diff --git a/railties/test/application/initializers/frameworks_test.rb b/railties/test/application/initializers/frameworks_test.rb index c2d4a0f2c8..d3bbac811c 100644 --- a/railties/test/application/initializers/frameworks_test.rb +++ b/railties/test/application/initializers/frameworks_test.rb @@ -163,26 +163,6 @@ module ApplicationTests end # AR - test "database middleware doesn't initialize when session store is not active_record" do - add_to_config <<-RUBY - config.root = "#{app_path}" - config.session_store :cookie_store, { :key => "blahblahblah" } - RUBY - require "#{app_path}/config/environment" - - assert !Rails.application.config.middleware.include?(ActiveRecord::SessionStore) - end - - test "database middleware initializes when session store is active record" do - add_to_config "config.session_store :active_record_store" - - require "#{app_path}/config/environment" - - expects = [ActiveRecord::ConnectionAdapters::ConnectionManagement, ActiveRecord::QueryCache, ActiveRecord::SessionStore] - middleware = Rails.application.config.middleware.map { |m| m.klass } - assert_equal expects, middleware & expects - end - test "active_record extensions are applied to ActiveRecord" do add_to_config "config.active_record.table_name_prefix = 'tbl_'" require "#{app_path}/config/environment" diff --git a/railties/test/generators/session_migration_generator_test.rb b/railties/test/generators/session_migration_generator_test.rb deleted file mode 100644 index b590047ff0..0000000000 --- a/railties/test/generators/session_migration_generator_test.rb +++ /dev/null @@ -1,27 +0,0 @@ -require 'generators/generators_test_helper' -require 'rails/generators/rails/session_migration/session_migration_generator' - -class SessionMigrationGeneratorTest < Rails::Generators::TestCase - include GeneratorsTestHelper - - def test_session_migration_with_default_name - run_generator - assert_migration "db/migrate/add_sessions_table.rb", /class AddSessionsTable < ActiveRecord::Migration/ - end - - def test_session_migration_with_given_name - run_generator ["create_session_table"] - assert_migration "db/migrate/create_session_table.rb", /class CreateSessionTable < ActiveRecord::Migration/ - end - - def test_session_migration_with_custom_table_name - ActiveRecord::SessionStore::Session.table_name = "custom_table_name" - run_generator - assert_migration "db/migrate/add_sessions_table.rb" do |migration| - assert_match(/class AddSessionsTable < ActiveRecord::Migration/, migration) - assert_match(/create_table :custom_table_name/, migration) - end - ensure - ActiveRecord::SessionStore::Session.table_name = "sessions" - end -end |