2007-01-22 14:43:50 +01:00
|
|
|
ENV["RAILS_ENV"] = "test"
|
|
|
|
$:.unshift(File.dirname(__FILE__) + '/../lib')
|
|
|
|
$:.unshift(File.dirname(__FILE__) + '/../../activesupport/lib')
|
|
|
|
$:.unshift(File.dirname(__FILE__) + '/../../actionpack/lib')
|
|
|
|
$:.unshift(File.dirname(__FILE__) + '/../../activerecord/lib')
|
|
|
|
|
|
|
|
require 'test/unit'
|
|
|
|
require 'action_web_service'
|
|
|
|
require 'action_controller'
|
|
|
|
require 'action_controller/test_process'
|
|
|
|
|
2007-02-09 09:04:31 +01:00
|
|
|
# Show backtraces for deprecated behavior for quicker cleanup.
|
|
|
|
ActiveSupport::Deprecation.debug = true
|
|
|
|
|
|
|
|
|
|
|
|
ActionController::Base.logger = Logger.new("debug.log")
|
2007-01-22 14:43:50 +01:00
|
|
|
ActionController::Base.ignore_missing_templates = true
|
|
|
|
|
|
|
|
begin
|
|
|
|
PATH_TO_AR = File.dirname(__FILE__) + '/../../activerecord'
|
|
|
|
require "#{PATH_TO_AR}/lib/active_record" unless Object.const_defined?(:ActiveRecord)
|
|
|
|
require "#{PATH_TO_AR}/lib/active_record/fixtures" unless Object.const_defined?(:Fixtures)
|
2007-02-09 09:04:31 +01:00
|
|
|
rescue LoadError => e
|
2007-01-22 14:43:50 +01:00
|
|
|
fail "\nFailed to load activerecord: #{e}"
|
|
|
|
end
|
|
|
|
|
2007-02-09 09:04:31 +01:00
|
|
|
ActiveRecord::Base.configurations = {
|
|
|
|
'mysql' => {
|
|
|
|
:adapter => "mysql",
|
|
|
|
:username => "rails",
|
|
|
|
:encoding => "utf8",
|
|
|
|
:database => "actionwebservice_unittest"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ActiveRecord::Base.establish_connection 'mysql'
|
2007-01-22 14:43:50 +01:00
|
|
|
|
|
|
|
Test::Unit::TestCase.fixture_path = "#{File.dirname(__FILE__)}/fixtures/"
|
|
|
|
|
|
|
|
# restore default raw_post functionality
|
|
|
|
class ActionController::TestRequest
|
|
|
|
def raw_post
|
|
|
|
super
|
|
|
|
end
|
2007-02-09 09:04:31 +01:00
|
|
|
end
|