Sha256: a3bc0e7e6685930102baca6340fe98edae0584e022bcd52b3c0cbe72e2c819f4

Contents?: true

Size: 714 Bytes

Versions: 4

Compression:

Stored size: 714 Bytes

Contents

$: << File.join(File.dirname(__FILE__), "/../lib" )

# Set the default environment to sqlite3's in_memory database
ENV['RAILS_ENV'] ||= 'test'
ENV['RAILS_ROOT'] = 'app_root'

# Load the Rails environment and testing framework
require "#{File.dirname(__FILE__)}/app_root/config/environment"
require 'rspec/rails'
require 'database_cleaner'

FileUtils.rm(Dir.glob("#{Rails.root}/db/*.db"), :force => true)

# Run the migrations
print "\033[30m" # dark gray text
ActiveRecord::Migrator.migrate("#{Rails.root}/db/migrate")
print "\033[0m"

RSpec.configure do |config|
  config.use_transactional_fixtures = false
  config.use_instantiated_fixtures  = false
  config.before(:each) do
    DatabaseCleaner.clean
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
query_diet-0.5.2 spec/rails-3.2/spec_helper.rb
query_diet-0.5.1 spec/rails-3.2/spec_helper.rb
query_diet-0.5.0 spec/rails-3.2/spec_helper.rb
query_diet-0.4.0 spec/rails-3.2/spec_helper.rb