Sha256: 5ffd95da2e9a79fca1a9fbd0a393306e6f6b09cb5616f52dd669b67205e043cf

Contents?: true

Size: 688 Bytes

Versions: 9

Compression:

Stored size: 688 Bytes

Contents

ENV['RACK_ENV'] ||= 'test'
require File.expand_path('../config/environment', __dir__)

RSpec.configure do |config|
  # ActiveRecord::Migration
  config.before :suite do
    ActiveRecord::Migration.maintain_test_schema!
  end if defined?(ActiveRecord)

  # DatabaseCleaner
  config.before :suite do
    DatabaseCleaner.strategy = :transaction
    DatabaseCleaner.clean_with :truncation
  end
  config.around do |example|
    DatabaseCleaner.cleaning { example.run }
  end

  # FactoryBot
  config.include FactoryBot::Syntax::Methods
  config.before :suite do
    FactoryBot.find_definitions
  end
end

# Test with Airborne
Airborne.configure do |config|
  config.rack_app = Grape::App
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
grape-app-0.11.3 lib/grape/app/templates/spec/spec_helper.rb
grape-app-0.11.2 lib/grape/app/templates/spec/spec_helper.rb
grape-app-0.11.1 lib/grape/app/templates/spec/spec_helper.rb
grape-app-0.11.0 lib/grape/app/templates/spec/spec_helper.rb
grape-app-0.10.1 lib/grape/app/templates/spec/spec_helper.rb
grape-app-0.10.0 lib/grape/app/templates/spec/spec_helper.rb
grape-app-0.9.0 lib/grape/app/templates/spec/spec_helper.rb
grape-app-0.8.8 lib/grape/app/templates/spec/spec_helper.rb
grape-app-0.8.7 lib/grape/app/templates/spec/spec_helper.rb