Sha256: b091c7d906efb1820292b764275c1a7fd3fb6e97da1660587f167d224af9c429
Contents?: true
Size: 1.26 KB
Versions: 18
Compression:
Stored size: 1.26 KB
Contents
# Configure Rails Environment ENV["RAILS_ENV"] = "test" TEST_ORM = (ENV["TEST_ORM"] || :active_record).to_sym if TEST_ORM == :mongoid require 'mongoid' require File.expand_path("../dummy_mongoid/config/environment.rb", __FILE__) else require File.expand_path("../dummy_activerecord/config/environment.rb", __FILE__) end require "rails/test_help" require "shoulda" require "mocha/setup" require "database_cleaner" Rails.backtrace_cleaner.remove_silencers! # Load support files Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f } # Load fixtures from the engine if ActiveSupport::TestCase.method_defined?(:fixture_path=) ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__) end # Configure database cleaning DatabaseCleaner.strategy = (TEST_ORM == :mongoid ? :truncation : :transaction) class ActiveSupport::TestCase # Stop ActiveRecord from wrapping tests in transactions if TEST_ORM == :active_record self.use_transactional_fixtures = false end setup { DatabaseCleaner.start } teardown { DatabaseCleaner.clean } end # For generators require "rails/generators/test_case" require "generators/maestrano/install_generator" require "generators/maestrano/user_generator" require "generators/maestrano/group_generator"
Version data entries
18 entries across 18 versions & 2 rubygems