diff options
author | Eugene Bolshakov <eugene.bolshakov@gmail.com> | 2008-11-17 21:55:56 -0600 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2008-11-17 21:56:39 -0600 |
commit | 3c9beb3dab73013af83b90983f283b76625052b8 (patch) | |
tree | ab5c1eabfe79142bfbac484abf31157516b751b3 /railties/lib/rails_generator/generators/components/scaffold | |
parent | d22fe41cf87d781ce1af264b37ba3eca762b74c3 (diff) | |
download | rails-3c9beb3dab73013af83b90983f283b76625052b8.tar.gz rails-3c9beb3dab73013af83b90983f283b76625052b8.tar.bz2 rails-3c9beb3dab73013af83b90983f283b76625052b8.zip |
Add helper test generators [#1199 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
Diffstat (limited to 'railties/lib/rails_generator/generators/components/scaffold')
-rw-r--r-- | railties/lib/rails_generator/generators/components/scaffold/scaffold_generator.rb | 2 | ||||
-rw-r--r-- | railties/lib/rails_generator/generators/components/scaffold/templates/helper_test.rb | 4 |
2 files changed, 6 insertions, 0 deletions
diff --git a/railties/lib/rails_generator/generators/components/scaffold/scaffold_generator.rb b/railties/lib/rails_generator/generators/components/scaffold/scaffold_generator.rb index ff0381da2a..2a5edeedb6 100644 --- a/railties/lib/rails_generator/generators/components/scaffold/scaffold_generator.rb +++ b/railties/lib/rails_generator/generators/components/scaffold/scaffold_generator.rb @@ -47,6 +47,7 @@ class ScaffoldGenerator < Rails::Generator::NamedBase m.directory(File.join('app/views/layouts', controller_class_path)) m.directory(File.join('test/functional', controller_class_path)) m.directory(File.join('test/unit', class_path)) + m.directory(File.join('test/unit/helpers', class_path)) m.directory(File.join('public/stylesheets', class_path)) for action in scaffold_views @@ -66,6 +67,7 @@ class ScaffoldGenerator < Rails::Generator::NamedBase m.template('functional_test.rb', File.join('test/functional', controller_class_path, "#{controller_file_name}_controller_test.rb")) m.template('helper.rb', File.join('app/helpers', controller_class_path, "#{controller_file_name}_helper.rb")) + m.template('helper_test.rb', File.join('test/unit/helpers', controller_class_path, "#{controller_file_name}_helper_test.rb")) m.route_resources controller_file_name diff --git a/railties/lib/rails_generator/generators/components/scaffold/templates/helper_test.rb b/railties/lib/rails_generator/generators/components/scaffold/templates/helper_test.rb new file mode 100644 index 0000000000..061f64a5e3 --- /dev/null +++ b/railties/lib/rails_generator/generators/components/scaffold/templates/helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class <%= controller_class_name %>HelperTest < ActionView::TestCase +end |