diff options
Diffstat (limited to 'railties/test/generators/session_migration_generator_test.rb')
-rw-r--r-- | railties/test/generators/session_migration_generator_test.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/railties/test/generators/session_migration_generator_test.rb b/railties/test/generators/session_migration_generator_test.rb index f83109800b..57bd755a9a 100644 --- a/railties/test/generators/session_migration_generator_test.rb +++ b/railties/test/generators/session_migration_generator_test.rb @@ -2,6 +2,16 @@ require 'abstract_unit' require 'generators/generators_test_helper' require 'generators/rails/session_migration/session_migration_generator' +module ActiveRecord + module SessionStore + class Session + class << self + attr_accessor :table_name + end + end + end +end + class SessionMigrationGeneratorTest < GeneratorsTestCase def test_session_migration_with_default_name @@ -14,6 +24,14 @@ class SessionMigrationGeneratorTest < GeneratorsTestCase 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 + end protected def run_generator(args=[]) |