diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-11-16 20:30:28 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-11-16 20:30:28 +0000 |
commit | 9f43627d2f117b0b3c635827a0e6196d6ec0314f (patch) | |
tree | 0a9aef70ae601bf762c3f4617706fe49c15e6557 /railties | |
parent | 65a29b34337955f9576a5c975a887696c86fa829 (diff) | |
download | rails-9f43627d2f117b0b3c635827a0e6196d6ec0314f.tar.gz rails-9f43627d2f117b0b3c635827a0e6196d6ec0314f.tar.bz2 rails-9f43627d2f117b0b3c635827a0e6196d6ec0314f.zip |
Use the new TestCase subclasses in the scaffold and resource generators also. Closes #10174 [bscofield]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8154 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties')
2 files changed, 6 insertions, 22 deletions
diff --git a/railties/lib/rails_generator/generators/components/resource/templates/functional_test.rb b/railties/lib/rails_generator/generators/components/resource/templates/functional_test.rb index 47697816f3..ddecb55872 100644 --- a/railties/lib/rails_generator/generators/components/resource/templates/functional_test.rb +++ b/railties/lib/rails_generator/generators/components/resource/templates/functional_test.rb @@ -1,15 +1,7 @@ -require File.dirname(__FILE__) + '<%= '/..' * controller_class_nesting_depth %>/../test_helper' -require '<%= controller_file_path %>_controller' +require File.dirname(__FILE__) + '<%= '/..' * class_nesting_depth %>/../test_helper' -# Re-raise errors caught by the controller. -class <%= controller_class_name %>Controller; def rescue_action(e) raise e end; end - -class <%= controller_class_name %>ControllerTest < Test::Unit::TestCase - def setup - @controller = <%= controller_class_name %>Controller.new - @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new - end +class <%= controller_class_name %>ControllerTest < ActionController::TestCase + tests <%= controller_class_name %>Controller # Replace this with your real tests. def test_truth diff --git a/railties/lib/rails_generator/generators/components/scaffold/templates/functional_test.rb b/railties/lib/rails_generator/generators/components/scaffold/templates/functional_test.rb index 992d80e808..823b21a4b3 100644 --- a/railties/lib/rails_generator/generators/components/scaffold/templates/functional_test.rb +++ b/railties/lib/rails_generator/generators/components/scaffold/templates/functional_test.rb @@ -1,15 +1,7 @@ -require File.dirname(__FILE__) + '<%= '/..' * controller_class_nesting_depth %>/../test_helper' -require '<%= controller_file_path %>_controller' +require File.dirname(__FILE__) + '<%= '/..' * class_nesting_depth %>/../test_helper' -# Re-raise errors caught by the controller. -class <%= controller_class_name %>Controller; def rescue_action(e) raise e end; end - -class <%= controller_class_name %>ControllerTest < Test::Unit::TestCase - def setup - @controller = <%= controller_class_name %>Controller.new - @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new - end +class <%= controller_class_name %>ControllerTest < ActionController::TestCase + tests <%= controller_class_name %>Controller def test_should_get_index get :index |