Upgraded to Rails 2.1. This can have wide ranging consequences, so please help track down any issues introduced by the upgrade. Requires environment.rb modifications.

Changes you will need to make:

 * In your environment.rb, you will need to update references to a few files per environment.rb.tmpl
 * In your environment.rb, you will need to specify the local time zone of the computer that is running your Tracks install.

Other notes on my changes:

 * Modified our code to take advantage of Rails 2.1's slick time zone support.
 * Upgraded will_paginate for compatibility
 * Hacked the Selenium on Rails plugin, which has not been updated in some time and does not support Rails 2.1
 * Verified that all tests pass on my machine, including Selenium tests -- I'd like confirmation from others, too.
This commit is contained in:
Luke Melia 2008-06-17 01:13:25 -04:00
parent f3bae73868
commit 901a58f8a3
1086 changed files with 51452 additions and 19526 deletions

View file

@ -1,27 +1,23 @@
require File.dirname(__FILE__) + '/../abstract_unit'
$:.unshift File.dirname(__FILE__) + '/../../../railties/lib'
require 'abstract_unit'
require 'action_controller/integration'
uses_mocha 'integration' do
# Stub process for testing.
module ActionController
module Integration
class Session
def process(*args)
end
def generic_url_rewriter
end
end
module IntegrationSessionStubbing
def stub_integration_session(session)
session.stubs(:process)
session.stubs(:generic_url_rewriter)
end
end
class SessionTest < Test::Unit::TestCase
include IntegrationSessionStubbing
def setup
@session = ActionController::Integration::Session.new
stub_integration_session(@session)
end
def test_https_bang_works_and_sets_truth_by_default
assert !@session.https?
@session.https!
@ -212,11 +208,13 @@ class SessionTest < Test::Unit::TestCase
end
class IntegrationTestTest < Test::Unit::TestCase
include IntegrationSessionStubbing
def setup
@test = ::ActionController::IntegrationTest.new(:default_test)
@test.class.stubs(:fixture_table_names).returns([])
@session = @test.open_session
stub_integration_session(@session)
end
def test_opens_new_session
@ -235,12 +233,15 @@ end
# Tests that integration tests don't call Controller test methods for processing.
# Integration tests have their own setup and teardown.
class IntegrationTestUsesCorrectClass < ActionController::IntegrationTest
include IntegrationSessionStubbing
def self.fixture_table_names
[]
end
def test_integration_methods_called
reset!
stub_integration_session(@integration_session)
%w( get post head put delete ).each do |verb|
assert_nothing_raised("'#{verb}' should use integration test methods") { send!(verb, '/') }
end
@ -248,8 +249,4 @@ class IntegrationTestUsesCorrectClass < ActionController::IntegrationTest
end
# TODO
# class MockCGITest < Test::Unit::TestCase
# end
end # uses_mocha