aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/generators/test_unit/controller
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/generators/test_unit/controller')
-rw-r--r--railties/lib/generators/test_unit/controller/controller_generator.rb14
-rw-r--r--railties/lib/generators/test_unit/controller/templates/functional_test.rb8
2 files changed, 22 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..b57a6e794f
--- /dev/null
+++ b/railties/lib/generators/test_unit/controller/controller_generator.rb
@@ -0,0 +1,14 @@
+require 'generators/test_unit'
+
+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