diff options
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 |