Sha256: 5a8de2eb5ae2f4fb3513938c8c145dca684ad8153878cda2ed2305b9519071bd

Contents?: true

Size: 675 Bytes

Versions: 1

Compression:

Stored size: 675 Bytes

Contents

require 'bundler/setup'
Bundler.setup
require 'pry'
require 'rack/test'
require 'rack/reducer'
require 'sequel'
require_relative 'behavior'
ENV['RACK_ENV'] = ENV['RAILS_ENV'] = 'test'
DB = Sequel.connect "sqlite://#{__dir__}/fixtures.sqlite"

SEQUEL_QUERY = {
  dataset: DB[:artists],
  filters: [
    ->(genre:) { grep(:genre, "%#{genre}%", case_insensitive: true) },
    ->(name:) { grep(:name, "%#{name}%", case_insensitive: true) },
    ->(order: 'genre') { order(order.to_sym) },
    ->(releases: ) { where(release_count: releases.to_i) },
  ]
}.freeze

RSpec.configure do |config|
  config.color = true
  config.order = :random
  config.include Rack::Test::Methods
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rack-reducer-0.1.2 spec/spec_helper.rb