Sha256: cf8e65ebe08a72b08e438785e0ef047883a225178aa45c4cc04060bf0cf09f31

Contents?: true

Size: 918 Bytes

Versions: 31

Compression:

Stored size: 918 Bytes

Contents

Bundler.setup :default, :test
Bundler.require :default, :test
ENV['RACK_ENV'] = 'test'

begin
  APP=Rack::Builder.parse_file(File.expand_path('../config.ru', __dir__)).first
rescue => e
  puts "Application failed to initialize:"
  raise e
  exit 1
end

# Migrate and seed the DB (only an empty in-memory DB)

ActiveRecord::Migration.verbose = false # ?? does not seem to work like this
ActiveRecord::Tasks::DatabaseTasks.migrate
require_relative '../db/seeds.rb'

RSpec.configure do |config|
  config.include Rack::Test::Methods

  config.before(:suite) do
    # Praxis::Blueprint.caching_enabled = true
    DatabaseCleaner.strategy = :transaction
  end
  config.around(:each) do |example|
    DatabaseCleaner.cleaning do
      example.run
    end
  end

  # config.before(:each) do
  #   Praxis::Blueprint.cache = Hash.new do |hash, key|
  #     hash[key] = Hash.new
  #   end
  # end
  
  def app
    APP
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
praxis-2.0.0 tasks/thor/templates/generator/example_app/spec/spec_helper.rb
praxis-2.0.pre.40 tasks/thor/templates/generator/example_app/spec/spec_helper.rb
praxis-2.0.pre.39 tasks/thor/templates/generator/example_app/spec/spec_helper.rb
praxis-2.0.pre.38 tasks/thor/templates/generator/example_app/spec/spec_helper.rb
praxis-2.0.pre.37 tasks/thor/templates/generator/example_app/spec/spec_helper.rb
praxis-2.0.pre.36 tasks/thor/templates/generator/example_app/spec/spec_helper.rb
praxis-2.0.pre.35 tasks/thor/templates/generator/example_app/spec/spec_helper.rb
praxis-2.0.pre.34 tasks/thor/templates/generator/example_app/spec/spec_helper.rb
praxis-2.0.pre.33 tasks/thor/templates/generator/example_app/spec/spec_helper.rb
praxis-2.0.pre.32 tasks/thor/templates/generator/example_app/spec/spec_helper.rb
praxis-2.0.pre.31 tasks/thor/templates/generator/example_app/spec/spec_helper.rb
praxis-2.0.pre.30 tasks/thor/templates/generator/example_app/spec/spec_helper.rb
praxis-2.0.pre.29 tasks/thor/templates/generator/example_app/spec/spec_helper.rb
praxis-2.0.pre.28 tasks/thor/templates/generator/example_app/spec/spec_helper.rb
praxis-2.0.pre.27 tasks/thor/templates/generator/example_app/spec/spec_helper.rb
praxis-2.0.pre.26 tasks/thor/templates/generator/example_app/spec/spec_helper.rb
praxis-2.0.pre.25 tasks/thor/templates/generator/example_app/spec/spec_helper.rb
praxis-2.0.pre.24 tasks/thor/templates/generator/example_app/spec/spec_helper.rb
praxis-2.0.pre.23 tasks/thor/templates/generator/example_app/spec/spec_helper.rb
praxis-2.0.pre.22 tasks/thor/templates/generator/example_app/spec/spec_helper.rb