summaryrefslogtreecommitdiff
path: root/spec/workers/concerns/pipeline_queue_spec.rb
blob: dd91176094813ea8fb5e286d83f97794d49b750c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
require 'spec_helper'

describe PipelineQueue do
  let(:worker) do
    Class.new do
      def self.name
        'DummyWorker'
      end

      include ApplicationWorker
      include PipelineQueue
    end
  end

  it 'sets a default pipelines queue automatically' do
    expect(worker.sidekiq_options['queue'])
      .to eq 'pipeline_default'
  end

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

      expect(worker.sidekiq_options['queue'])
        .to eq 'pipeline_processing'
    end
  end
end