mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-22 08:46:11 +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
58
vendor/rails/actionpack/lib/action_view/test_case.rb
vendored
Normal file
58
vendor/rails/actionpack/lib/action_view/test_case.rb
vendored
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
require 'active_support/test_case'
|
||||
|
||||
module ActionView
|
||||
class TestCase < ActiveSupport::TestCase
|
||||
class_inheritable_accessor :helper_class
|
||||
@@helper_class = nil
|
||||
|
||||
class << self
|
||||
def tests(helper_class)
|
||||
self.helper_class = helper_class
|
||||
end
|
||||
|
||||
def helper_class
|
||||
if current_helper_class = read_inheritable_attribute(:helper_class)
|
||||
current_helper_class
|
||||
else
|
||||
self.helper_class = determine_default_helper_class(name)
|
||||
end
|
||||
end
|
||||
|
||||
def determine_default_helper_class(name)
|
||||
name.sub(/Test$/, '').constantize
|
||||
rescue NameError
|
||||
nil
|
||||
end
|
||||
end
|
||||
|
||||
ActionView::Base.helper_modules.each do |helper_module|
|
||||
include helper_module
|
||||
end
|
||||
include ActionController::PolymorphicRoutes
|
||||
include ActionController::RecordIdentifier
|
||||
|
||||
setup :setup_with_helper_class
|
||||
|
||||
def setup_with_helper_class
|
||||
if helper_class && !self.class.ancestors.include?(helper_class)
|
||||
self.class.send(:include, helper_class)
|
||||
end
|
||||
end
|
||||
|
||||
class TestController < ActionController::Base
|
||||
attr_accessor :request, :response
|
||||
|
||||
def initialize
|
||||
@request = ActionController::TestRequest.new
|
||||
@response = ActionController::TestResponse.new
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
def method_missing(selector, *args)
|
||||
controller = TestController.new
|
||||
return controller.send!(selector, *args) if ActionController::Routing::Routes.named_routes.helpers.include?(selector)
|
||||
super
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue