mirror of
https://github.com/TracksApp/tracks.git
synced 2026-03-13 07:56:17 +01:00
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:
parent
f3bae73868
commit
901a58f8a3
1086 changed files with 51452 additions and 19526 deletions
|
|
@ -1,4 +1,4 @@
|
|||
require File.dirname(__FILE__) + '/../abstract_unit'
|
||||
require 'abstract_unit'
|
||||
|
||||
class ViewLoadPathsTest < Test::Unit::TestCase
|
||||
|
||||
|
|
@ -16,7 +16,7 @@ class ViewLoadPathsTest < Test::Unit::TestCase
|
|||
def hello_world_at_request_time() render(:action => 'hello_world') end
|
||||
private
|
||||
def add_view_path
|
||||
self.class.view_paths.unshift "#{LOAD_PATH_ROOT}/override"
|
||||
prepend_view_path "#{LOAD_PATH_ROOT}/override"
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -27,11 +27,15 @@ class ViewLoadPathsTest < Test::Unit::TestCase
|
|||
|
||||
def setup
|
||||
TestController.view_paths = nil
|
||||
ActionView::Base.cache_template_extensions = false
|
||||
@controller = TestController.new
|
||||
|
||||
@request = ActionController::TestRequest.new
|
||||
@response = ActionController::TestResponse.new
|
||||
|
||||
|
||||
@controller = TestController.new
|
||||
# Following is needed in order to setup @controller.template object properly
|
||||
@controller.send :initialize_template_class, @response
|
||||
@controller.send :assign_shortcuts, @request, @response
|
||||
|
||||
# Track the last warning.
|
||||
@old_behavior = ActiveSupport::Deprecation.behavior
|
||||
@last_message = nil
|
||||
|
|
@ -40,7 +44,6 @@ class ViewLoadPathsTest < Test::Unit::TestCase
|
|||
|
||||
def teardown
|
||||
ActiveSupport::Deprecation.behavior = @old_behavior
|
||||
ActionView::Base.cache_template_extensions = true
|
||||
end
|
||||
|
||||
def test_template_load_path_was_set_correctly
|
||||
|
|
@ -48,18 +51,18 @@ class ViewLoadPathsTest < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
def test_controller_appends_view_path_correctly
|
||||
TestController.append_view_path 'foo'
|
||||
@controller.append_view_path 'foo'
|
||||
assert_equal [LOAD_PATH_ROOT, 'foo'], @controller.view_paths
|
||||
|
||||
TestController.append_view_path(%w(bar baz))
|
||||
@controller.append_view_path(%w(bar baz))
|
||||
assert_equal [LOAD_PATH_ROOT, 'foo', 'bar', 'baz'], @controller.view_paths
|
||||
end
|
||||
|
||||
def test_controller_prepends_view_path_correctly
|
||||
TestController.prepend_view_path 'baz'
|
||||
@controller.prepend_view_path 'baz'
|
||||
assert_equal ['baz', LOAD_PATH_ROOT], @controller.view_paths
|
||||
|
||||
TestController.prepend_view_path(%w(foo bar))
|
||||
@controller.prepend_view_path(%w(foo bar))
|
||||
assert_equal ['foo', 'bar', 'baz', LOAD_PATH_ROOT], @controller.view_paths
|
||||
end
|
||||
|
||||
|
|
@ -94,7 +97,7 @@ class ViewLoadPathsTest < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
def test_view_paths_override
|
||||
TestController.view_paths.unshift "#{LOAD_PATH_ROOT}/override"
|
||||
TestController.prepend_view_path "#{LOAD_PATH_ROOT}/override"
|
||||
get :hello_world
|
||||
assert_response :success
|
||||
assert_equal "Hello overridden world!", @response.body
|
||||
|
|
@ -134,4 +137,4 @@ class ViewLoadPathsTest < Test::Unit::TestCase
|
|||
assert_equal ['c/path'], C.view_paths
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue