2010-03-18 14:02:55 -04:00
|
|
|
require 'rubygems'
|
2009-05-27 11:21:20 -04:00
|
|
|
|
2010-03-18 14:02:55 -04:00
|
|
|
require 'test/unit'
|
2009-11-19 21:51:25 -05:00
|
|
|
require 'shoulda'
|
2009-05-27 11:21:20 -04:00
|
|
|
|
2010-03-18 14:02:55 -04:00
|
|
|
require 'active_record'
|
|
|
|
require 'action_controller'
|
|
|
|
require 'action_controller/test_process'
|
|
|
|
require 'active_support'
|
|
|
|
require 'active_support/test_case'
|
2009-05-27 11:21:20 -04:00
|
|
|
|
2010-03-18 14:02:55 -04:00
|
|
|
require 'lib/paper_trail'
|
2009-05-27 11:21:20 -04:00
|
|
|
|
2010-03-18 14:02:55 -04:00
|
|
|
def connect_to_database
|
|
|
|
ActiveRecord::Base.establish_connection(
|
|
|
|
:adapter => "sqlite3",
|
|
|
|
:database => ":memory:"
|
|
|
|
)
|
|
|
|
ActiveRecord::Migration.verbose = false
|
2009-05-27 11:21:20 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def load_schema
|
|
|
|
connect_to_database
|
2010-03-18 14:02:55 -04:00
|
|
|
load File.dirname(__FILE__) + '/schema.rb'
|
2009-05-27 11:21:20 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def change_schema
|
2010-03-18 14:02:55 -04:00
|
|
|
load File.dirname(__FILE__) + '/schema_change.rb'
|
|
|
|
end
|
|
|
|
|
|
|
|
class ActiveRecord::Base
|
|
|
|
def logger
|
|
|
|
@logger ||= Logger.new(nil)
|
|
|
|
end
|
2009-05-27 11:21:20 -04:00
|
|
|
end
|
2010-03-18 14:02:55 -04:00
|
|
|
|
2010-03-19 14:53:49 -04:00
|
|
|
class ActionController::Base
|
|
|
|
def logger
|
|
|
|
@logger ||= Logger.new(nil)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2010-03-18 14:02:55 -04:00
|
|
|
load_schema
|