Sha256: 9c5615dd96c6ba5399688ca466bca0b5404ff3bbd65e4ab197b39df4724d6938

Contents?: true

Size: 742 Bytes

Versions: 16

Compression:

Stored size: 742 Bytes

Contents

ENV["SINATRA_ENV"] = "test"

require_relative '../config/environment'
require 'rack/test'
require 'capybara/rspec'
require 'capybara/dsl'

if ActiveRecord::Migrator.needs_migration?
  raise 'Migrations are pending. Run `rake db:migrate SINATRA_ENV=test` to resolve the issue.'
end

ActiveRecord::Base.logger = nil

RSpec.configure do |config|
  config.run_all_when_everything_filtered = true
  config.filter_run :focus
  config.include Rack::Test::Methods
  config.include Capybara::DSL
  DatabaseCleaner.strategy = :truncation

  config.before do
    DatabaseCleaner.clean
  end

  config.after do
    DatabaseCleaner.clean
  end

  config.order = 'default'
end

def app
  Rack::Builder.parse_file('config.ru').first
end

Capybara.app = app

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
corneal-1.2.3 lib/corneal/generators/app/templates/spec/spec_helper.rb
natra-0.0.4 lib/natra/generators/app/templates/spec/spec_helper.rb
natra-0.0.3 lib/natra/generators/app/templates/spec/spec_helper.rb
natra-0.0.2 lib/natra/generators/app/templates/spec/spec_helper.rb
natra-0.0.1 lib/natra/generators/app/templates/spec/spec_helper.rb
corneal-1.2.2 lib/corneal/generators/app/templates/spec/spec_helper.rb
corneal-1.2.1 lib/corneal/generators/app/templates/spec/spec_helper.rb
corneal-1.2.0 lib/corneal/generators/app/templates/spec/spec_helper.rb
corneal-1.1.0 lib/corneal/generators/app/templates/spec/spec_helper.rb
corneal-1.0.0 lib/corneal/generators/app/templates/spec/spec_helper.rb
corneal-0.1.5 lib/templates/spec/spec_helper.rb
corneal-0.1.4 lib/templates/spec/spec_helper.rb
corneal-0.1.3 lib/templates/spec/spec_helper.rb
corneal-0.1.2 lib/templates/spec/spec_helper.rb
corneal-0.1.1 lib/templates/spec/spec_helper.rb
corneal-0.1.0 lib/templates/spec/spec_helper.rb