Skip to content

Commit

Permalink
update to Rails 2.3.4 and clean up old test syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
jweiss committed Nov 2, 2009
1 parent f30fea6 commit 0b9308b
Show file tree
Hide file tree
Showing 915 changed files with 52,383 additions and 56,030 deletions.
2 changes: 0 additions & 2 deletions app/controllers/stylesheets_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ class StylesheetsController < ApplicationController
skip_before_filter CASClient::Frameworks::Rails::Filter
end

session :off

caches_page :application

def application
Expand Down
3 changes: 1 addition & 2 deletions config/environment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# ENV['RAILS_ENV'] ||= 'production'

# Specifies gem version of Rails to use when vendor/rails is not present
RAILS_GEM_VERSION = '2.2.2' unless defined? RAILS_GEM_VERSION
RAILS_GEM_VERSION = '2.3.4' unless defined? RAILS_GEM_VERSION

# Bootstrap the Rails environment, frameworks, and default configuration
require File.join(File.dirname(__FILE__), 'boot')
Expand All @@ -32,7 +32,6 @@
config.gem 'net-sftp', :version => '2.0.2', :lib => 'net/sftp'
config.gem 'net-ssh-gateway', :version => '1.0.1', :lib => 'net/ssh/gateway'
config.gem 'capistrano', :version => '2.5.9'
config.gem 'mocha', :version => '0.4.0'
config.gem 'highline', :version => '1.5.1'
config.gem 'open4', :version => '0.9.3'
config.gem 'syntax', :version => '1.0.0'
Expand Down
3 changes: 3 additions & 0 deletions config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@
# The :test delivery method accumulates sent emails in the
# ActionMailer::Base.deliveries array.
config.action_mailer.delivery_method = :test

require 'test/unit'
config.gem 'mocha', :version => '0.9.8'
11 changes: 1 addition & 10 deletions test/functional/deployments_controller_test.rb
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
require File.dirname(__FILE__) + '/../test_helper'
require 'deployments_controller'

# Re-raise errors caught by the controller.
class DeploymentsController; def rescue_action(e) raise e end; end

class DeploymentsControllerTest < Test::Unit::TestCase
fixtures :deployments
class DeploymentsControllerTest < ActionController::TestCase

def setup
@controller = DeploymentsController.new
@request = ActionController::TestRequest.new
@response = ActionController::TestResponse.new

@project = create_new_project(:name => 'Project X')
@stage = create_new_stage(:name => 'Prod', :project => @project)
@role = create_new_role(:name => 'web', :stage => @stage)
Expand Down
11 changes: 1 addition & 10 deletions test/functional/hosts_controller_test.rb
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
require File.dirname(__FILE__) + '/../test_helper'
require 'hosts_controller'

# Re-raise errors caught by the controller.
class HostsController; def rescue_action(e) raise e end; end

class HostsControllerTest < Test::Unit::TestCase
fixtures :hosts
class HostsControllerTest < ActionController::TestCase

def setup
@controller = HostsController.new
@request = ActionController::TestRequest.new
@response = ActionController::TestResponse.new

@host = create_new_host
end

Expand Down
11 changes: 1 addition & 10 deletions test/functional/project_configurations_controller_test.rb
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
require File.dirname(__FILE__) + '/../test_helper'
require 'project_configurations_controller'

# Re-raise errors caught by the controller.
class ProjectConfigurationsController; def rescue_action(e) raise e end; end

class ProjectConfigurationsControllerTest < Test::Unit::TestCase
fixtures :project_configurations
class ProjectConfigurationsControllerTest < ActionController::TestCase

def setup
@controller = ProjectConfigurationsController.new
@request = ActionController::TestRequest.new
@response = ActionController::TestResponse.new

@project = create_new_project
@config = create_new_project_configuration(:project => @project)
@user = login
Expand Down
11 changes: 1 addition & 10 deletions test/functional/projects_controller_test.rb
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
require File.dirname(__FILE__) + '/../test_helper'
require 'projects_controller'

# Re-raise errors caught by the controller.
class ProjectsController; def rescue_action(e) raise e end; end

class ProjectsControllerTest < Test::Unit::TestCase
fixtures :projects
class ProjectsControllerTest < ActionController::TestCase

def setup
@controller = ProjectsController.new
@request = ActionController::TestRequest.new
@response = ActionController::TestResponse.new

@project = create_new_project
end

Expand Down
10 changes: 1 addition & 9 deletions test/functional/recipes_controller_test.rb
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
require File.dirname(__FILE__) + '/../test_helper'
require 'recipes_controller'

# Re-raise errors caught by the controller.
class RecipesController; def rescue_action(e) raise e end; end

class RecipesControllerTest < Test::Unit::TestCase
class RecipesControllerTest < ActionController::TestCase

def setup
@controller = RecipesController.new
@request = ActionController::TestRequest.new
@response = ActionController::TestResponse.new

@recipe = create_new_recipe
end

Expand Down
11 changes: 1 addition & 10 deletions test/functional/roles_controller_test.rb
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
require File.dirname(__FILE__) + '/../test_helper'
require 'roles_controller'

# Re-raise errors caught by the controller.
class RolesController; def rescue_action(e) raise e end; end

class RolesControllerTest < Test::Unit::TestCase
fixtures :roles
class RolesControllerTest < ActionController::TestCase

def setup
@controller = RolesController.new
@request = ActionController::TestRequest.new
@response = ActionController::TestResponse.new

@project = create_new_project
@stage = create_new_stage(:project => @project)
@host = create_new_host
Expand Down
10 changes: 2 additions & 8 deletions test/functional/sessions_controller_test.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
require File.dirname(__FILE__) + '/../test_helper'
require 'sessions_controller'

# Re-raise errors caught by the controller.
class SessionsController; def rescue_action(e) raise e end; end

class SessionsControllerTest < Test::Unit::TestCase
# Be sure to include AuthenticatedTestHelper in test/test_helper.rb instead
# Then, you can remove it from this and the units test.
class SessionsControllerTest < ActionController::TestCase
include AuthenticatedTestHelper

fixtures :users
Expand Down Expand Up @@ -57,7 +51,7 @@ def test_should_not_remember_me
def test_should_delete_token_on_logout
login_as :quentin
get :destroy
assert_equal @response.cookies["auth_token"], []
assert_nil @response.cookies["auth_token"]
end

def test_should_login_with_cookie
Expand Down
11 changes: 1 addition & 10 deletions test/functional/stage_configurations_controller_test.rb
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
require File.dirname(__FILE__) + '/../test_helper'
require 'stage_configurations_controller'

# Re-raise errors caught by the controller.
class StageConfigurationsController; def rescue_action(e) raise e end; end

class StageConfigurationsControllerTest < Test::Unit::TestCase
fixtures :stage_configurations
class StageConfigurationsControllerTest < ActionController::TestCase

def setup
@controller = StageConfigurationsController.new
@request = ActionController::TestRequest.new
@response = ActionController::TestResponse.new

@project = create_new_project
@stage = create_new_stage(:project => @project)
@config = create_new_stage_configuration(:stage => @stage)
Expand Down
11 changes: 1 addition & 10 deletions test/functional/stages_controller_test.rb
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
require File.dirname(__FILE__) + '/../test_helper'
require 'stages_controller'

# Re-raise errors caught by the controller.
class StagesController; def rescue_action(e) raise e end; end

class StagesControllerTest < Test::Unit::TestCase
fixtures :stages
class StagesControllerTest < ActionController::TestCase

def setup
@controller = StagesController.new
@request = ActionController::TestRequest.new
@response = ActionController::TestResponse.new

@project = create_new_project(:template => 'mongrel_rails')
@stage = create_new_stage(:project => @project, :name => 'my_stage')
@user = login
Expand Down
11 changes: 1 addition & 10 deletions test/functional/stylesheets_controller_test.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
require File.dirname(__FILE__) + '/../test_helper'
require 'stylesheets_controller'

# Re-raise errors caught by the controller.
class StylesheetsController; def rescue_action(e) raise e end; end

class StylesheetsControllerTest < Test::Unit::TestCase
def setup
@controller = StylesheetsController.new
@request = ActionController::TestRequest.new
@response = ActionController::TestResponse.new
end
class StylesheetsControllerTest < ActionController::TestCase

# Replace this with your real tests.
def test_truth
Expand Down
13 changes: 1 addition & 12 deletions test/functional/users_controller_test.rb
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
require File.dirname(__FILE__) + '/../test_helper'
require 'users_controller'

# Re-raise errors caught by the controller.
class UsersController; def rescue_action(e) raise e end; end

class UsersControllerTest < Test::Unit::TestCase
fixtures :users

def setup
@controller = UsersController.new
@request = ActionController::TestRequest.new
@response = ActionController::TestResponse.new
end
class UsersControllerTest < ActionController::TestCase

def test_should_not_allow_for_non_admins_to_create_users
login
Expand Down
2 changes: 1 addition & 1 deletion test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
require 'mocha'
require File.expand_path(File.dirname(__FILE__) + "/factories")

class Test::Unit::TestCase
class ActiveSupport::TestCase
include AuthenticatedTestHelper
include Factories

Expand Down
2 changes: 1 addition & 1 deletion test/unit/configuration_parameter_test.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require File.dirname(__FILE__) + '/../test_helper'

class ConfigurationParameterTest < Test::Unit::TestCase
class ConfigurationParameterTest < ActiveSupport::TestCase

def setup
@project = create_new_project
Expand Down
2 changes: 1 addition & 1 deletion test/unit/deployment_test.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require File.dirname(__FILE__) + '/../test_helper'

class DeploymentTest < Test::Unit::TestCase
class DeploymentTest < ActiveSupport::TestCase

def setup
@stage = create_new_stage
Expand Down
2 changes: 1 addition & 1 deletion test/unit/host_test.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require File.dirname(__FILE__) + '/../test_helper'

class HostTest < Test::Unit::TestCase
class HostTest < ActiveSupport::TestCase

def setup
Host.delete_all
Expand Down
2 changes: 1 addition & 1 deletion test/unit/notification_test.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require File.dirname(__FILE__) + '/../test_helper'

class NotificationTest < Test::Unit::TestCase
class NotificationTest < ActiveSupport::TestCase
FIXTURES_PATH = File.dirname(__FILE__) + '/../fixtures'
CHARSET = "utf-8"

Expand Down
2 changes: 1 addition & 1 deletion test/unit/project_configuration_test.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require File.dirname(__FILE__) + '/../test_helper'

class ProjectConfigurationTest < Test::Unit::TestCase
class ProjectConfigurationTest < ActiveSupport::TestCase

def test_templates
assert_not_nil ProjectConfiguration.templates
Expand Down
2 changes: 1 addition & 1 deletion test/unit/project_test.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require File.dirname(__FILE__) + '/../test_helper'

class ProjectTest < Test::Unit::TestCase
class ProjectTest < ActiveSupport::TestCase

def test_creation
assert_equal 0, Project.count
Expand Down
2 changes: 1 addition & 1 deletion test/unit/recipe_test.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require File.dirname(__FILE__) + '/../test_helper'

class RecipeTest < Test::Unit::TestCase
class RecipeTest < ActiveSupport::TestCase

def test_create
assert_nothing_raised{
Expand Down
2 changes: 1 addition & 1 deletion test/unit/role_test.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require File.dirname(__FILE__) + '/../test_helper'

class RoleTest < Test::Unit::TestCase
class RoleTest < ActiveSupport::TestCase

def setup
@stage = create_new_stage
Expand Down
2 changes: 1 addition & 1 deletion test/unit/stage_configuration_test.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require File.dirname(__FILE__) + '/../test_helper'

class StageConfigurationTest < Test::Unit::TestCase
class StageConfigurationTest < ActiveSupport::TestCase

def test_uniqiness_of_name
p = create_new_project
Expand Down
2 changes: 1 addition & 1 deletion test/unit/stage_test.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require File.dirname(__FILE__) + '/../test_helper'

class StageTest < Test::Unit::TestCase
class StageTest < ActiveSupport::TestCase

def setup
Stage.delete_all
Expand Down
2 changes: 1 addition & 1 deletion test/unit/user_test.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require File.dirname(__FILE__) + '/../test_helper'

class UserTest < Test::Unit::TestCase
class UserTest < 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
8 changes: 4 additions & 4 deletions test/unit/webistrano_deployer_test.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require File.dirname(__FILE__) + '/../test_helper'

class Webistrano::DeployerTest < Test::Unit::TestCase
class Webistrano::DeployerTest < ActiveSupport::TestCase

def setup
@project = create_new_project(:template => 'pure_file')
Expand Down Expand Up @@ -385,11 +385,11 @@ def test_config_logger_and_real_revision_are_set
#

# Logger stubing
mock_cap_logger = mock
mock_cap_logger = mock()
mock_cap_logger.expects(:level=).with(3)

# config stubbing
mock_cap_config = mock
mock_cap_config = mock()
mock_cap_config.stubs(:logger).returns(mock_cap_logger)
mock_cap_config.stubs(:logger=)
mock_cap_config.stubs(:load)
Expand All @@ -412,7 +412,7 @@ def test_config_logger_and_real_revision_are_set
else
[:password, :application, :repository, :real_revision, :webistrano_stage, :webistrano_project].include?(x)
end
}.times(8)
}.times(7)

# main mock install
Webistrano::Configuration.expects(:new).returns(mock_cap_config)
Expand Down
2 changes: 1 addition & 1 deletion test/unit/webistrano_logger_test.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require File.dirname(__FILE__) + '/../test_helper'

class Webistrano::LoggerTest < Test::Unit::TestCase
class Webistrano::LoggerTest < ActiveSupport::TestCase

def setup
@project = create_new_project(:template => 'rails')
Expand Down
Loading

0 comments on commit 0b9308b

Please sign in to comment.