Sha256: c5ac962af8b044bd4985b58c64c69ada620f0e117b8481c625d55ddf018ecfdc

Contents?: true

Size: 821 Bytes

Versions: 1

Compression:

Stored size: 821 Bytes

Contents

require "spec_helper"

describe "Batch" do
  module Sidekiq
    module Batch
      class Status
      end
    end
  end

  load File.expand_path(File.join(File.dirname(__FILE__), "../../../lib/rspec/sidekiq/batch.rb"))

  describe "NullStatus" do
    describe "#total" do
      it "returns 0 when no jobs" do
        null_status = Sidekiq::Batch.new.status
        expect(null_status.total).to eq(0)
      end

      it "returns 1 when 1 job" do
        batch = Sidekiq::Batch.new

        batch.jobs do
          TestWorker.perform_async('5')
        end

        null_status = batch.status

        expect(null_status.total).to eq(1)
      end
    end

    describe "#bid" do
      it "returns a bid" do
        null_status = Sidekiq::Batch.new
        expect(null_status.bid).to_not be_nil
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rspec-sidekiq-1.1.0 spec/rspec/sidekiq/batch_spec.rb