Sha256: 1e9c4dcb036215b007234d74eaa3f2462fa7b138044959210dce1208b04a8fc7

Contents?: true

Size: 447 Bytes

Versions: 4

Compression:

Stored size: 447 Bytes

Contents

require 'active_record'
require 'database_cleaner'

db = YAML.load(File.open('config/database.yml'))['test']
ActiveRecord::Base.establish_connection(db)

RSpec.configure do |config|
  config.before(:suite) do
    DatabaseCleaner.strategy = :transaction
    DatabaseCleaner.clean_with(:truncation)
  end

  config.before(:each) do
    DatabaseCleaner.start
  end

  config.after(:each) do
    DatabaseCleaner.clean
  end
end unless defined?(Rails)

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
sortables-0.0.2 spec/spec_no_rails_helper.rb
pubdraft-0.0.2 spec/spec_no_rails_helper.rb
pubdraft-0.0.1 spec/spec_no_rails_helper.rb
sortables-0.0.1 spec/spec_no_rails_helper.rb