Sha256: 42076c41e367b3ea4a2a4e6d631f28315a74abb0c68a69bbc980a1a389441935

Contents?: true

Size: 694 Bytes

Versions: 14

Compression:

Stored size: 694 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 :each 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

14 entries across 14 versions & 1 rubygems

Version Path
grape-app-0.8.6 lib/grape/app/templates/spec/spec_helper.rb
grape-app-0.8.5 lib/grape/app/templates/spec/spec_helper.rb
grape-app-0.8.4 lib/grape/app/templates/spec/spec_helper.rb
grape-app-0.8.3 lib/grape/app/templates/spec/spec_helper.rb
grape-app-0.8.2 lib/grape/app/templates/spec/spec_helper.rb
grape-app-0.8.1 lib/grape/app/templates/spec/spec_helper.rb
grape-app-0.8.0 lib/grape/app/templates/spec/spec_helper.rb
grape-app-0.7.1 lib/grape/app/templates/spec/spec_helper.rb
grape-app-0.6.4 lib/grape/app/templates/spec/spec_helper.rb
grape-app-0.6.3 lib/grape/app/templates/spec/spec_helper.rb
grape-app-0.6.2 lib/grape/app/templates/spec/spec_helper.rb
grape-app-0.6.1 lib/grape/app/templates/spec/spec_helper.rb
grape-app-0.6.0 lib/grape/app/templates/spec/spec_helper.rb
grape-app-0.5.3 lib/grape/app/templates/spec/spec_helper.rb