Skip to content

Commit

Permalink
updated to use Rails 2 test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Clinton R. Nixon committed Jun 16, 2008
1 parent 2d24dae commit 0efec8a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 15 deletions.
8 changes: 1 addition & 7 deletions generators/authenticated/templates/test/functional_test.rb
Expand Up @@ -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]
Expand Down
Expand Up @@ -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 %>
Expand Down
2 changes: 1 addition & 1 deletion 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
Expand Down

0 comments on commit 0efec8a

Please sign in to comment.