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