diff options
author | José Valim <jose.valim@gmail.com> | 2009-06-30 08:49:25 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2009-07-02 10:27:39 +0200 |
commit | dec1ee7422417c38cdcbea428d922c67eb3e708f (patch) | |
tree | ad0209dc9c23223e22e5109e2b18de08a5b215ef /railties/test/generators | |
parent | 1c265da1db934ffab0a5151dc7beeed3ef1bbabb (diff) | |
download | rails-dec1ee7422417c38cdcbea428d922c67eb3e708f.tar.gz rails-dec1ee7422417c38cdcbea428d922c67eb3e708f.tar.bz2 rails-dec1ee7422417c38cdcbea428d922c67eb3e708f.zip |
Started with scaffold controller and added remove_hook_for.
Diffstat (limited to 'railties/test/generators')
-rw-r--r-- | railties/test/generators/resource_generator_test.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/railties/test/generators/resource_generator_test.rb b/railties/test/generators/resource_generator_test.rb index 456e6ff3ea..53e9a1e817 100644 --- a/railties/test/generators/resource_generator_test.rb +++ b/railties/test/generators/resource_generator_test.rb @@ -86,6 +86,20 @@ class ResourceGeneratorTest < GeneratorsTestCase end end + def test_plural_names_are_singularized + content = run_generator ["accounts"] + assert_file "app/models/account.rb", /class Account < ActiveRecord::Base/ + assert_file "test/unit/account_test.rb", /class AccountTest/ + assert_match /Plural version of the model detected, using singularized version. Override with --force-plural./, content + end + + def test_plural_names_can_be_forced + content = run_generator ["accounts", "--force-plural"] + assert_file "app/models/accounts.rb", /class Accounts < ActiveRecord::Base/ + assert_file "test/unit/accounts_test.rb", /class AccountsTest/ + assert_no_match /Plural version of the model detected/, content + end + protected def run_generator(args=["account"]) |