diff options
author | José Valim <jose.valim@gmail.com> | 2009-06-26 11:57:40 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2009-06-26 11:59:14 +0200 |
commit | e2346244a25ea9365ce0c93ca355c710b6712304 (patch) | |
tree | 053cf9f20741971ee71727626da9ff08feaf2d6d /railties/lib/generators/test_unit | |
parent | d40bd851190dd734a09965979c8ade285e51d52c (diff) | |
download | rails-e2346244a25ea9365ce0c93ca355c710b6712304.tar.gz rails-e2346244a25ea9365ce0c93ca355c710b6712304.tar.bz2 rails-e2346244a25ea9365ce0c93ca355c710b6712304.zip |
Added Controller Generators.
Diffstat (limited to 'railties/lib/generators/test_unit')
-rw-r--r-- | railties/lib/generators/test_unit/controller/controller_generator.rb | 11 | ||||
-rw-r--r-- | railties/lib/generators/test_unit/controller/templates/functional_test.rb | 8 |
2 files changed, 19 insertions, 0 deletions
diff --git a/railties/lib/generators/test_unit/controller/controller_generator.rb b/railties/lib/generators/test_unit/controller/controller_generator.rb new file mode 100644 index 0000000000..d0d12d79e9 --- /dev/null +++ b/railties/lib/generators/test_unit/controller/controller_generator.rb @@ -0,0 +1,11 @@ +module TestUnit + module Generators + class ControllerGenerator < Base + check_class_collision :suffix => "ControllerTest" + + def create_test_files + template 'functional_test.rb', File.join('test/functional', class_path, "#{file_name}_controller_test.rb") + end + end + end +end diff --git a/railties/lib/generators/test_unit/controller/templates/functional_test.rb b/railties/lib/generators/test_unit/controller/templates/functional_test.rb new file mode 100644 index 0000000000..62fa5d86fd --- /dev/null +++ b/railties/lib/generators/test_unit/controller/templates/functional_test.rb @@ -0,0 +1,8 @@ +require 'test_helper' + +class <%= class_name %>ControllerTest < ActionController::TestCase + # Replace this with your real tests. + test "the truth" do + assert true + end +end |