Sha256: 0abe3706514ba8cfc9ded9af81bddec6c3a1b15b6447c591109d95bf8eb7591a

Contents?: true

Size: 931 Bytes

Versions: 3

Compression:

Stored size: 931 Bytes

Contents

ENV['RACK_ENV'] = 'test'

require 'simplecov'
require 'codecov'
SimpleCov.start
SimpleCov.formatter = SimpleCov::Formatter::Codecov
require File.expand_path('../../config/environment', __FILE__)
require 'rspec'
require 'shoulda-matchers'
require 'factory_girl'
require 'database_cleaner'

Shoulda::Matchers.configure do |config|
  config.integrate do |with|
    with.library :active_record
    with.test_framework :rspec
  end
end

RSpec.configure do |config|
  #Shoulda-Matchers
  config.include(Shoulda::Matchers::ActiveModel, type: :model)
  config.include(Shoulda::Matchers::ActiveRecord, type: :model)

  #Factory Girl
  config.include(FactoryGirl::Syntax::Methods)
  config.before(:suite) do
    FactoryGirl.find_definitions
    DatabaseCleaner.strategy = :transaction
    DatabaseCleaner.clean_with(:truncation)
  end

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
sumcli-0.6.0 lib/sumcli/templates/new/app/spec/spec_helper.rb
sumcli-0.4.0 lib/sumcli/templates/new/app/spec/spec_helper.rb
sumcli-0.1.0 lib/sumcli/templates/new/app/spec/spec_helper.rb