Sha256: ab4cb68fccf988804d166e758913ba6179e982038204de7d9e7f95dd3a4acaeb

Contents?: true

Size: 633 Bytes

Versions: 8

Compression:

Stored size: 633 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

RSpec.configure do |config|

  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

8 entries across 8 versions & 1 rubygems

Version Path
learn-generate-1.0.16 lib/templates/sinatra-mvc/spec/spec_helper.rb
learn-generate-1.0.15 lib/templates/sinatra-mvc/spec/spec_helper.rb
learn-generate-1.0.14 lib/templates/sinatra-mvc/spec/spec_helper.rb
learn-generate-1.0.13 lib/templates/sinatra-mvc/spec/spec_helper.rb
learn-generate-1.0.12 lib/templates/sinatra-mvc/spec/spec_helper.rb
learn-generate-1.0.11 lib/templates/sinatra-mvc/spec/spec_helper.rb
learn-generate-1.0.1 lib/templates/sinatra-mvc/spec/spec_helper.rb
learn-generate-1.0.0 lib/templates/sinatra-mvc/spec/spec_helper.rb