Permalink
Browse files

Use the new TestCase subclasses in the scaffold and resource generato…

…rs also. Closes #10174 [bscofield]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8154 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 65a29b3 commit 9f43627d2f117b0b3c635827a0e6196d6ec0314f @jeremy jeremy committed Nov 16, 2007
@@ -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
@@ -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

0 comments on commit 9f43627

Please sign in to comment.