1
0
Fork 0
mirror of https://github.com/paper-trail-gem/paper_trail.git synced 2022-11-09 11:33:19 -05:00
paper-trail-gem--paper_trail/test/test_helper.rb

44 lines
755 B
Ruby
Raw Normal View History

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'
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
class ActionController::Base
def logger
@logger ||= Logger.new(nil)
end
end
2010-03-18 14:02:55 -04:00
load_schema