diff options
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/generators/model_generator_test.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/railties/test/generators/model_generator_test.rb b/railties/test/generators/model_generator_test.rb index f5cfd8eeca..ef415a4fed 100644 --- a/railties/test/generators/model_generator_test.rb +++ b/railties/test/generators/model_generator_test.rb @@ -27,6 +27,14 @@ class ModelGeneratorTest < Rails::Generators::TestCase assert_file "app/models/account.rb", /class Account < Admin::Account/ end + def test_model_with_namespace + run_generator ["admin/account"] + assert_file "app/models/admin.rb", /module Admin/ + assert_file "app/models/admin.rb", /def self\.table_name_prefix/ + assert_file "app/models/admin.rb", /'admin_'/ + assert_file "app/models/admin/account.rb", /class Admin::Account < ActiveRecord::Base/ + end + def test_migration run_generator assert_migration "db/migrate/create_accounts.rb", /class CreateAccounts < ActiveRecord::Migration/ |