From a2e2e73c5ef7c9082810d77c831c50c91011e6d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Mon, 18 Jan 2010 10:43:10 +0100 Subject: Ensure generators can be invoked by their shortcut and remove attr_reader tasks. --- railties/test/generators/actions_test.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'railties/test/generators/actions_test.rb') 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' -- cgit v1.2.3