diff options
Diffstat (limited to 'railties/test/generators/actions_test.rb')
-rw-r--r-- | railties/test/generators/actions_test.rb | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/railties/test/generators/actions_test.rb b/railties/test/generators/actions_test.rb index 27b6a49566..cb1fa96e0d 100644 --- a/railties/test/generators/actions_test.rb +++ b/railties/test/generators/actions_test.rb @@ -1,7 +1,11 @@ require 'generators/generators_test_helper' -require 'rails/generators/rails/app/app_generator' +require 'generators/rails/app/app_generator' -class ActionsTest < GeneratorsTestCase +# TODO This line shouldn't be required +require 'generators/rails/model/model_generator' + +class ActionsTest < Rails::Generators::TestCase + include GeneratorsTestHelper tests Rails::Generators::AppGenerator arguments [destination_root] @@ -11,6 +15,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: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' |