diff options
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/generators/model_generator_test.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/railties/test/generators/model_generator_test.rb b/railties/test/generators/model_generator_test.rb index 62e1c5ab9e..85aa2cc145 100644 --- a/railties/test/generators/model_generator_test.rb +++ b/railties/test/generators/model_generator_test.rb @@ -52,6 +52,17 @@ class ModelGeneratorTest < GeneratorsTestCase end end + def test_migration_without_timestamps + ActiveRecord::Base.timestamped_migrations = false + run_generator ["account"] + assert_file "db/migrate/001_create_accounts.rb", /class CreateAccounts < ActiveRecord::Migration/ + + run_generator ["project"] + assert_file "db/migrate/002_create_projects.rb", /class CreateProjects < ActiveRecord::Migration/ + ensure + ActiveRecord::Base.timestamped_migrations = true + end + def test_model_with_references_attribute_generates_belongs_to_associations run_generator ["product", "name:string", "supplier_id:references"] assert_file "app/models/product.rb", /belongs_to :supplier/ |