Sha256: f0b536da4fb1674dda620adb65f25e3b542b1513cd23ac296276aebf6e242553

Contents?: true

Size: 981 Bytes

Versions: 2

Compression:

Stored size: 981 Bytes

Contents

require 'coveralls'
Coveralls.wear!

require "rails/all"
require 'foreign_key_validation'
require 'rspec/rails'
require 'database_cleaner'
require 'pry'

RSpec.configure do |config|
  config.run_all_when_everything_filtered = true
  config.filter_run :focus
  config.infer_base_class_for_anonymous_controllers = true

  # reset and reload model classes for each run
  config.before(:each) do
    load "support/reset_models.rb"
    load "support/load_models.rb"
  end

  config.before(:suite) do
    puts "Running specs against Rails #{Rails.version}" if defined?(Rails)
    DatabaseCleaner.strategy = :transaction
    DatabaseCleaner.clean_with(:truncation)
  end

  config.around(:each) do |example|
    DatabaseCleaner.cleaning do
      example.run
    end
  end

  config.order = 'random'
end

setup_sqlite_db = lambda do
  ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: ':memory:')
  load "support/schema.rb"
end
silence_stream(STDOUT, &setup_sqlite_db)

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
foreign_key_validation-1.0.1 spec/spec_helper.rb
foreign_key_validation-1.0.0 spec/spec_helper.rb