diff options
author | José Valim <jose.valim@gmail.com> | 2010-01-18 10:43:10 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-01-18 16:21:10 +0100 |
commit | a2e2e73c5ef7c9082810d77c831c50c91011e6d9 (patch) | |
tree | 86eb986b1cc598859c3930c52f09e243dce40f9a /railties/test/generators | |
parent | 4c00c65c58055b341b4ca59a38c3c93082049c84 (diff) | |
download | rails-a2e2e73c5ef7c9082810d77c831c50c91011e6d9.tar.gz rails-a2e2e73c5ef7c9082810d77c831c50c91011e6d9.tar.bz2 rails-a2e2e73c5ef7c9082810d77c831c50c91011e6d9.zip |
Ensure generators can be invoked by their shortcut and remove attr_reader tasks.
Diffstat (limited to 'railties/test/generators')
-rw-r--r-- | railties/test/generators/actions_test.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/railties/test/generators/actions_test.rb b/railties/test/generators/actions_test.rb index 27b6a49566..196cec3ce7 100644 --- a/railties/test/generators/actions_test.rb +++ b/railties/test/generators/actions_test.rb @@ -1,6 +1,9 @@ require 'generators/generators_test_helper' require 'rails/generators/rails/app/app_generator' +# TODO This line shouldn't be required +require 'rails/generators/rails/model/model_generator' + class ActionsTest < GeneratorsTestCase tests Rails::Generators::AppGenerator arguments [destination_root] @@ -11,6 +14,16 @@ class ActionsTest < GeneratorsTestCase @svn_plugin_uri = 'svn://svnhub.com/technoweenie/restful-authentication/trunk' end + def test_invoke_other_generator_with_shortcut + action :invoke, 'model', ['my_model'] + assert_file 'app/models/my_model.rb', /MyModel/ + end + + def test_invoke_other_generator_with_full_namespace + action :invoke, 'rails:generators:model', ['my_model'] + assert_file 'app/models/my_model.rb', /MyModel/ + end + def test_create_file_should_write_data_to_file_path action :create_file, 'lib/test_file.rb', 'heres test data' assert_file 'lib/test_file.rb', 'heres test data' |