test/test_helper.rb in conductor-0.8.3 vs test/test_helper.rb in conductor-0.9.3
- old
+ new
@@ -1,29 +1,15 @@
+# Configure Rails Environment
ENV["RAILS_ENV"] = "test"
-$:.unshift(File.dirname(__FILE__) + '/../lib')
-require 'rubygems'
-require 'active_record'
-require 'active_record/version'
-require 'active_record/fixtures'
-require 'action_controller'
-require 'action_controller/test_process'
-require 'action_view'
-require 'active_support'
-require 'test/unit'
-require 'conductor'
-require 'shoulda'
+require File.expand_path("../../spec/dummy/config/environment.rb", __FILE__)
+require "rails/test_help"
-require File.dirname(__FILE__) + '/../init.rb'
+Rails.backtrace_cleaner.remove_silencers!
+# Load support files
+Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
-config = YAML::load(IO.read(File.dirname(__FILE__) + '/db/database.yml'))
-# ActiveRecord::Base.logger = Logger.new(STDOUT) # Logger.new(File.dirname(__FILE__) + "/debug.log")
-ActiveRecord::Base.establish_connection(config[ENV['DB'] || 'postgresql'])
-ActiveRecord::Migration.verbose = false
-load(File.dirname(__FILE__) + "/db/schema.rb")
-
-@@cache = ActiveSupport::Cache::MemoryStore.new
-
-class Test::Unit::TestCase
-
+# Load fixtures from the engine
+if ActiveSupport::TestCase.method_defined?(:fixture_path=)
+ ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
end