Sha256: 2751c956a2ca2e1eeb67151479b16acc74984f10dcc017a731fe0ac881339f35

Contents?: true

Size: 1.19 KB

Versions: 6

Compression:

Stored size: 1.19 KB

Contents

# frozen_string_literal: true

require 'rubygems'
require 'bundler/setup'
require 'pry'

require 'active_record'
ActiveRecord::Migration.verbose = false

require 'combustion'
Combustion.initialize! :active_record

require 'rspec/rails'
require 'webmock/rspec'
require 'factory_girl'
require 'simplecov'

require 'global_registry_bindings'

require 'sidekiq/testing'
require 'sidekiq_unique_jobs/testing'
Sidekiq::Testing.fake!

require 'mock_redis'
MOCK_REDIS = MockRedis.new

ActionController::Base.cache_store = :memory_store

RSpec.configure do |config|
  config.use_transactional_fixtures = true
  config.file_fixture_path = 'spec/fixtures'
  config.filter_run focus: true
  config.run_all_when_everything_filtered = true
  config.include ActiveSupport::Testing::TimeHelpers
  config.include FactoryGirl::Syntax::Methods

  config.before(:suite) do
    FactoryGirl.find_definitions
  end

  config.before(:each) do
    MOCK_REDIS.keys.each do |key|
      MOCK_REDIS.del(key)
    end

    SidekiqUniqueJobs.configure do |c|
      c.redis_test_mode = :mock
    end
    allow(Sidekiq).to receive(:redis).and_yield(MOCK_REDIS)

    Sidekiq::Queues.clear_all
    Sidekiq::Worker.clear_all
    Rails.cache.clear
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
global-registry-bindings-0.0.6 spec/spec_helper.rb
global-registry-bindings-0.0.5 spec/spec_helper.rb
global-registry-bindings-0.0.4 spec/spec_helper.rb
global-registry-bindings-0.0.3 spec/spec_helper.rb
global-registry-bindings-0.0.2 spec/spec_helper.rb
global-registry-bindings-0.0.1 spec/spec_helper.rb