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

Version Path
maestrano-rails-0.15.4 test/test_helper.rb
maestrano-rails-0.15.2 test/test_helper.rb
maestrano-rails-0.15.1 test/test_helper.rb
maestrano-rails-0.15.0 test/test_helper.rb
maestrano-rails-0.14.0 test/test_helper.rb
maestrano-rails-0.13.0 test/test_helper.rb
maestrano-rails-0.12.0 test/test_helper.rb
maestrano-rails-0.11.0 test/test_helper.rb
maestrano-rails-0.10.0 test/test_helper.rb
maestrano-rails-0.9.5 test/test_helper.rb
maestrano-rails-0.9.4 test/test_helper.rb
maestrano-rails-test-0.9.4 test/test_helper.rb
maestrano-rails-test-0.9.3 test/test_helper.rb
maestrano-rails-0.9.3 test/test_helper.rb
maestrano-rails-0.9.2 test/test_helper.rb
maestrano-rails-0.9.1 test/test_helper.rb
maestrano-rails-0.9.0 test/test_helper.rb
maestrano-rails-0.8.0 test/test_helper.rb