Sha256: fdbf9dc0e92c2c40581066a9f52841ab2b6763e76060063ed1773bd103813f98

Contents?: true

Size: 918 Bytes

Versions: 18

Compression:

Stored size: 918 Bytes

Contents

require 'spec_helper'
require 'sidekiq/batch'
require 'sidekiq/testing'

Sidekiq::Testing.server_middleware do |chain|
  chain.add CanvasSync::JobBatches::Batch::Middleware::ServerMiddleware
end

Sidekiq.redis { |r| r.flushdb }

def redis_keys
  Sidekiq.redis { |r| r.keys('BID-*') }
end

def dump_redis_keys
  puts redis_keys.inspect
end

def process_tests
  out_buf = StringIO.new
  Sidekiq.logger = Logger.new out_buf

  # Sidekiq.logger.level = :info

  Sidekiq::Worker.drain_all

  output = out_buf.string
  keys = redis_keys
  puts out_buf.string

  [output, keys]
end

def overall_tests output, keys
  describe "sidekiq batch" do
    it "runs overall complete callback" do
      expect(output).to include "Overall Complete"
    end

    it "runs overall success callback" do
      expect(output).to include "Overall Success"
    end

    it "cleans redis keys" do
      expect(keys).to eq([])
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
canvas_sync-0.17.2 spec/job_batching/integration_helper.rb
canvas_sync-0.17.1 spec/job_batching/integration_helper.rb
canvas_sync-0.17.0 spec/job_batching/integration_helper.rb
canvas_sync-0.17.0.beta15 spec/job_batching/integration_helper.rb
canvas_sync-0.17.0.beta14 spec/job_batching/integration_helper.rb
canvas_sync-0.17.0.beta13 spec/job_batching/integration_helper.rb
canvas_sync-0.17.0.beta12 spec/job_batching/integration_helper.rb
canvas_sync-0.17.0.beta11 spec/job_batching/integration_helper.rb
canvas_sync-0.17.0.beta10 spec/job_batching/integration_helper.rb
canvas_sync-0.17.0.beta9 spec/job_batching/integration_helper.rb
canvas_sync-0.17.0.beta8 spec/job_batching/integration_helper.rb
canvas_sync-0.17.0.beta7 spec/job_batching/integration_helper.rb
canvas_sync-0.17.0.beta6 spec/job_batching/integration_helper.rb
canvas_sync-0.17.0.beta5 spec/job_batching/integration_helper.rb
canvas_sync-0.17.0.beta4 spec/job_batching/integration_helper.rb
canvas_sync-0.17.0.beta3 spec/job_batching/integration_helper.rb
canvas_sync-0.17.0.beta2 spec/job_batching/integration_helper.rb
canvas_sync-0.17.0.beta1 spec/job_batching/integration_helper.rb