Sha256: 63f42f10d5d3d97f581b8742f0da36d891c0895d6cc072097f43bafaf1405675

Contents?: true

Size: 1.04 KB

Versions: 11

Compression:

Stored size: 1.04 KB

Contents

require 'spec_helper'

begin
  require 'rollbar/delay/sidekiq'
rescue LoadError
end

if defined?(Sidekiq)
  describe Rollbar::Delay::Sidekiq do
    before(:each) do
      reset_configuration
    end
  
    describe ".handler" do
      let(:payload) { anything }
  
      context "with default options" do
        before { Rollbar.configuration.use_sidekiq = true }
  
        it "enqueues to default queue" do
          ::Sidekiq::Client.should_receive(:push).with(Rollbar::Delay::Sidekiq::OPTIONS.merge('args' => payload))
          Rollbar::Delay::Sidekiq.handle(payload)
        end
      end
  
      context "with custom options" do
        let(:custom_config) { { 'queue' => 'custom_queue' } }
  
        before { Rollbar.configuration.use_sidekiq = custom_config }
  
        it "enqueues to custom queue" do
          options = Rollbar::Delay::Sidekiq::OPTIONS.merge(custom_config.merge('args' => payload))
          ::Sidekiq::Client.should_receive(:push).with options
  
          Rollbar::Delay::Sidekiq.handle(payload)
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
rollbar-0.11.8 spec/delay/sidekiq_spec.rb
rollbar-0.11.7 spec/delay/sidekiq_spec.rb
rollbar-0.11.6 spec/delay/sidekiq_spec.rb
rollbar-0.11.5 spec/delay/sidekiq_spec.rb
rollbar-0.11.4 spec/delay/sidekiq_spec.rb
rollbar-0.11.3 spec/delay/sidekiq_spec.rb
rollbar-0.11.2 spec/delay/sidekiq_spec.rb
rollbar-0.11.1 spec/delay/sidekiq_spec.rb
rollbar-0.10.14 spec/delay/sidekiq_spec.rb
rollbar-0.10.12 spec/delay/sidekiq_spec.rb
rollbar-0.10.11 spec/delay/sidekiq_spec.rb