mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-05 07:21:48 +01:00
It is IMO a great alternative to fixtures. See http://github.com/aiwilliams/scenarios/tree/master and further commits for more information.
24 lines
No EOL
701 B
Ruby
24 lines
No EOL
701 B
Ruby
require File.expand_path(File.dirname(__FILE__) + '/../testing/plugit_descriptor')
|
|
|
|
TESTING_ROOT = File.expand_path("#{File.dirname(__FILE__)}/../testing")
|
|
TESTING_TMP = "#{TESTING_ROOT}/tmp"
|
|
|
|
require 'fileutils'
|
|
FileUtils.mkdir_p(TESTING_TMP)
|
|
FileUtils.touch("#{TESTING_TMP}/test.log")
|
|
|
|
require 'logger'
|
|
RAILS_DEFAULT_LOGGER = Logger.new("#{TESTING_TMP}/test.log")
|
|
RAILS_DEFAULT_LOGGER.level = Logger::DEBUG
|
|
|
|
ActiveRecord::Base.silence do
|
|
ActiveRecord::Base.configurations = {'sqlite3' => {
|
|
'adapter' => 'sqlite3',
|
|
'database' => "#{TESTING_TMP}/sqlite3.db"
|
|
}}
|
|
ActiveRecord::Base.establish_connection 'sqlite3'
|
|
load "#{TESTING_ROOT}/schema.rb"
|
|
end
|
|
|
|
require "models"
|
|
require "scenarios" |