BigW Consortium Gitlab

pipeline_queue_spec.rb 531 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10
require 'spec_helper'

describe PipelineQueue do
  let(:worker) do
    Class.new do
      include Sidekiq::Worker
      include PipelineQueue
    end
  end

11 12
  it 'sets a default pipelines queue automatically' do
    expect(worker.sidekiq_options['queue'])
13
      .to eq 'pipeline_default'
14 15 16
  end

  describe '.enqueue_in' do
17 18
    it 'sets a custom sidekiq queue with prefix and group' do
      worker.enqueue_in(group: :processing)
19 20

      expect(worker.sidekiq_options['queue'])
21
        .to eq 'pipeline_processing'
22
    end
23 24
  end
end