require 'query_dam' require 'active_record' require 'models/item' require 'fakeredis/rspec' RSpec.configure do |config| config.order = :random config.expect_with :rspec do |expectations| expectations.syntax = :expect end config.mock_with :rspec do |mocks| mocks.syntax = :expect mocks.verify_partial_doubles = true end config.after(:each) do Item.destroy_all end end ActiveRecord::Base.establish_connection( adapter: 'sqlite3', database: 'spec/testdb.sqlite3') ActiveRecord::Base.connection.execute 'drop table if exists items' ActiveRecord::Base.connection.execute <<-SQL create table items ( id integer primary key, name varchar(255), quantity integer) SQL Redis.current = Redis.new(host: '127.0.0.1', port: 6379)