Sha256: ea28e11a73514d6ffb0d118c36df154669a820e22e1fc927b8ea38f5ac5d7970
Contents?: true
Size: 1.67 KB
Versions: 3
Compression:
Stored size: 1.67 KB
Contents
ENV['RAILS_ENV'] = 'test' require File.expand_path(File.dirname(__FILE__) + "/../../../../config/environment") require 'test_help' require 'mocha' require 'time' def Time.today t = now() mktime( t.year, t.mon, t.day ) end unless Time.respond_to?(:today) begin require 'redgreen' rescue LoadError end ## # Different DB settings and load our schema. # connection = case ENV['DB'] when /mysql/ { :adapter => 'mysql', :username => 'root', :database => 'typus_test' } when /postgresql/ { :adapter => 'postgresql', :encoding => 'unicode', :database => 'typus_test' } else { :adapter => 'sqlite3', :dbfile => ':memory:' } end ActiveRecord::Base.establish_connection(connection) ActiveRecord::Base.logger = Logger.new(File.dirname(__FILE__) + '/debug.log') require File.dirname(__FILE__) + '/schema' ## # To test the plugin without touching the application we set our # load_paths and view_paths. # ActiveSupport::Dependencies.load_paths = [] %w( models controllers helpers ).each do |folder| ActiveSupport::Dependencies.load_paths << File.join(Rails.root, 'vendor/plugins/typus/app', folder) ActiveSupport::Dependencies.load_paths << File.join(Rails.root, 'vendor/plugins/typus/test/fixtures/app', folder) end ActionController::Base.view_paths = [] %w( app/views test/fixtures/app/views ).each do |folder| ActionController::Base.append_view_path(File.join(Rails.root, 'vendor/plugins/typus', folder)) end class ActiveSupport::TestCase self.fixture_path = File.dirname(__FILE__) + '/fixtures' self.use_transactional_fixtures = true self.use_instantiated_fixtures = false fixtures :all end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
fesplugas-typus-0.9.6 | test/helper.rb |
fesplugas-typus-0.9.7 | test/helper.rb |
fesplugas-typus-0.9.8 | test/helper.rb |