Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

updated to use Rails 2 test cases

  • Loading branch information...
commit 0efec8a7e4bb0ab33f5e794fa2b105a6f46ef81b 1 parent 2d24dae
Clinton R. Nixon authored
View
8 generators/authenticated/templates/test/functional_test.rb
@@ -4,19 +4,13 @@
# 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
+class <%= controller_class_name %>ControllerTest < ActionController::TestCase
# Be sure to include AuthenticatedTestHelper in test/test_helper.rb instead
# Then, you can remove it from this and the units test.
include AuthenticatedTestHelper
fixtures :<%= table_name %>
- def setup
- @controller = <%= controller_class_name %>Controller.new
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
- end
-
def test_should_login_and_redirect
post :create, :login => 'quentin', :password => 'monkey'
assert session[:<%= file_name %>_id]
View
8 generators/authenticated/templates/test/model_functional_test.rb
@@ -4,19 +4,13 @@
# Re-raise errors caught by the controller.
class <%= model_controller_class_name %>Controller; def rescue_action(e) raise e end; end
-class <%= model_controller_class_name %>ControllerTest < Test::Unit::TestCase
+class <%= model_controller_class_name %>ControllerTest < ActionController::TestCase
# Be sure to include AuthenticatedTestHelper in test/test_helper.rb instead
# Then, you can remove it from this and the units test.
include AuthenticatedTestHelper
fixtures :<%= table_name %>
- def setup
- @controller = <%= model_controller_class_name %>Controller.new
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
- end
-
def test_should_allow_signup
assert_difference '<%= class_name %>.count' do
create_<%= file_name %>
View
2  generators/authenticated/templates/test/unit_test.rb
@@ -1,6 +1,6 @@
require File.dirname(__FILE__) + '/../test_helper'
-class <%= class_name %>Test < Test::Unit::TestCase
+class <%= class_name %>Test < ActiveSupport::TestCase
# Be sure to include AuthenticatedTestHelper in test/test_helper.rb instead.
# Then, you can remove it from this and the functional test.
include AuthenticatedTestHelper
Please sign in to comment.
Something went wrong with that request. Please try again.