Sha256: 56d30b2638b1cda01259ae48d96899004d9f0b8383bc30c5e7d56690d056261b

Contents?: true

Size: 996 Bytes

Versions: 7

Compression:

Stored size: 996 Bytes

Contents

require 'bundler'
require 'pry'
Bundler.require

require 'rspec/its'
require 'active_record'
require 'database_cleaner'

require 'support/model_helpers'
require 'support/muffle_helper'

ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: ':memory:')
ActiveRecord::Base.logger = Logger.new('/dev/null')

ActiveRecord::Schema.define do
  create_table :users do |t|
    t.column :email, :string
    t.column :projects, :text
    t.column :profile, :text
  end

  create_table :authors do |t|
    t.column :name, :string
  end
end

RSpec.configure do |config|
  config.mock_with :rspec
  config.order = :random
  config.run_all_when_everything_filtered = true
  config.filter_run focus: true

  config.include ModelHelpers
  config.include MuffleHelpers

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

  config.before do
    DatabaseCleaner.start
  end

  config.after do
    DatabaseCleaner.clean
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
active_data-1.1.6 spec/spec_helper.rb
active_data-1.1.5 spec/spec_helper.rb
active_data-1.1.4 spec/spec_helper.rb
active_data-1.1.3 spec/spec_helper.rb
active_data-1.1.2 spec/spec_helper.rb
active_data-1.1.1 spec/spec_helper.rb
active_data-1.1.0 spec/spec_helper.rb