2007-01-22 14:43:50 +01:00
|
|
|
$:.unshift(File.dirname(__FILE__) + '/../lib')
|
2008-10-27 07:47:01 +01:00
|
|
|
$:.unshift(File.dirname(__FILE__) + '/../../activesupport/lib')
|
2007-01-22 14:43:50 +01:00
|
|
|
$:.unshift(File.dirname(__FILE__) + '/fixtures/helpers')
|
2009-02-04 21:26:08 +01:00
|
|
|
$:.unshift(File.dirname(__FILE__) + '/fixtures/alternate_helpers')
|
2007-01-22 14:43:50 +01:00
|
|
|
|
2009-02-04 21:26:08 +01:00
|
|
|
require 'rubygems'
|
2007-01-22 14:43:50 +01:00
|
|
|
require 'yaml'
|
2007-12-21 08:48:59 +01:00
|
|
|
require 'stringio'
|
2007-01-22 14:43:50 +01:00
|
|
|
require 'test/unit'
|
2009-02-04 21:26:08 +01:00
|
|
|
|
2009-02-28 02:23:00 +01:00
|
|
|
gem 'mocha', '>= 0.9.5'
|
2009-02-04 21:26:08 +01:00
|
|
|
require 'mocha'
|
2007-01-22 14:43:50 +01:00
|
|
|
|
2007-12-21 08:48:59 +01:00
|
|
|
begin
|
|
|
|
require 'ruby-debug'
|
2009-02-04 21:26:08 +01:00
|
|
|
Debugger.settings[:autoeval] = true
|
|
|
|
Debugger.start
|
2007-12-21 08:48:59 +01:00
|
|
|
rescue LoadError
|
|
|
|
# Debugging disabled. `gem install ruby-debug` to enable.
|
|
|
|
end
|
|
|
|
|
2009-02-04 21:26:08 +01:00
|
|
|
require 'action_controller'
|
|
|
|
require 'action_controller/cgi_ext'
|
|
|
|
require 'action_controller/test_process'
|
|
|
|
require 'action_view/test_case'
|
|
|
|
|
2007-02-09 09:04:31 +01:00
|
|
|
# Show backtraces for deprecated behavior for quicker cleanup.
|
|
|
|
ActiveSupport::Deprecation.debug = true
|
|
|
|
|
2007-01-22 14:43:50 +01:00
|
|
|
ActionController::Base.logger = nil
|
2007-02-09 09:04:31 +01:00
|
|
|
ActionController::Routing::Routes.reload rescue nil
|
2007-12-21 08:48:59 +01:00
|
|
|
|
2009-02-04 21:26:08 +01:00
|
|
|
ActionController::Base.session_store = nil
|
|
|
|
|
|
|
|
# Register danish language for testing
|
|
|
|
I18n.backend.store_translations 'da', {}
|
2009-02-28 02:23:00 +01:00
|
|
|
I18n.backend.store_translations 'pt-BR', {}
|
2009-02-04 21:26:08 +01:00
|
|
|
ORIGINAL_LOCALES = I18n.available_locales.map(&:to_s).sort
|
|
|
|
|
2008-10-27 07:47:01 +01:00
|
|
|
FIXTURE_LOAD_PATH = File.join(File.dirname(__FILE__), 'fixtures')
|
2009-02-28 02:23:00 +01:00
|
|
|
ActionView::Base.cache_template_loading = true
|
2008-10-27 07:47:01 +01:00
|
|
|
ActionController::Base.view_paths = FIXTURE_LOAD_PATH
|
2009-02-28 02:23:00 +01:00
|
|
|
CACHED_VIEW_PATHS = ActionView::Base.cache_template_loading? ?
|
|
|
|
ActionController::Base.view_paths :
|
|
|
|
ActionController::Base.view_paths.map {|path| ActionView::Template::EagerPath.new(path.to_s)}
|