diff options
author | José Valim <jose.valim@gmail.com> | 2009-06-28 13:16:14 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2009-06-28 13:16:14 +0200 |
commit | 1ca51df0001a750fafb0da70e4560c1ec439236c (patch) | |
tree | 677de24572e4d698149694145f14dfd5438fea56 /railties/test/generators/session_migration_generator_test.rb | |
parent | 4f3e44fa03ab8fc47f75fa710b28c72b9b2328b9 (diff) | |
download | rails-1ca51df0001a750fafb0da70e4560c1ec439236c.tar.gz rails-1ca51df0001a750fafb0da70e4560c1ec439236c.tar.bz2 rails-1ca51df0001a750fafb0da70e4560c1ec439236c.zip |
Added migration and session_migration generator.
Diffstat (limited to 'railties/test/generators/session_migration_generator_test.rb')
-rw-r--r-- | railties/test/generators/session_migration_generator_test.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/railties/test/generators/session_migration_generator_test.rb b/railties/test/generators/session_migration_generator_test.rb new file mode 100644 index 0000000000..05b51b1566 --- /dev/null +++ b/railties/test/generators/session_migration_generator_test.rb @@ -0,0 +1,24 @@ +require 'abstract_unit' +require 'generators/generators_test_helper' +require 'generators/active_record/session_migration/session_migration_generator' +require 'generators/rails/session_migration/session_migration_generator' + +class SessionMigrationGeneratorTest < GeneratorsTestCase + + 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 + + protected + + def run_generator(args=[]) + silence(:stdout) { Rails::Generators::SessionMigrationGenerator.start args, :root => destination_root } + end + +end |