2005-04-02 16:03:36 -05:00
|
|
|
ENV["RAILS_ENV"] = "test"
|
2005-02-18 05:35:25 -05:00
|
|
|
$:.unshift(File.dirname(__FILE__) + '/../lib')
|
2005-07-06 17:50:27 -04:00
|
|
|
$:.unshift(File.dirname(__FILE__) + '/../../activesupport/lib')
|
|
|
|
$:.unshift(File.dirname(__FILE__) + '/../../actionpack/lib')
|
|
|
|
$:.unshift(File.dirname(__FILE__) + '/../../activerecord/lib')
|
2005-02-18 05:35:25 -05:00
|
|
|
|
|
|
|
require 'test/unit'
|
2005-02-18 18:55:29 -05:00
|
|
|
require 'action_web_service'
|
2005-02-18 05:35:25 -05:00
|
|
|
require 'action_controller'
|
|
|
|
require 'action_controller/test_process'
|
|
|
|
|
2006-09-03 23:38:13 -04:00
|
|
|
# Show backtraces for deprecated behavior for quicker cleanup.
|
|
|
|
ActiveSupport::Deprecation.debug = true
|
|
|
|
|
|
|
|
|
2006-08-14 19:14:08 -04:00
|
|
|
ActionController::Base.logger = Logger.new("debug.log")
|
2005-02-18 05:35:25 -05:00
|
|
|
ActionController::Base.ignore_missing_templates = true
|
2006-03-02 22:19:37 -05:00
|
|
|
|
|
|
|
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)
|
2006-08-30 23:16:28 -04:00
|
|
|
rescue LoadError => e
|
2006-03-02 22:19:37 -05:00
|
|
|
fail "\nFailed to load activerecord: #{e}"
|
|
|
|
end
|
|
|
|
|
2006-08-14 19:14:08 -04:00
|
|
|
ActiveRecord::Base.configurations = {
|
|
|
|
'mysql' => {
|
|
|
|
:adapter => "mysql",
|
|
|
|
:username => "rails",
|
|
|
|
:encoding => "utf8",
|
|
|
|
:database => "actionwebservice_unittest"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ActiveRecord::Base.establish_connection 'mysql'
|
2006-03-02 22:19:37 -05:00
|
|
|
|
|
|
|
Test::Unit::TestCase.fixture_path = "#{File.dirname(__FILE__)}/fixtures/"
|
2006-03-17 17:20:09 -05:00
|
|
|
|
|
|
|
# restore default raw_post functionality
|
|
|
|
class ActionController::TestRequest
|
|
|
|
def raw_post
|
|
|
|
super
|
|
|
|
end
|
2006-04-29 14:02:37 -04:00
|
|
|
end
|