2016-10-21 12:13:41 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe PipelineQueue do
|
|
|
|
let(:worker) do
|
|
|
|
Class.new do
|
2017-11-28 11:08:30 -05:00
|
|
|
def self.name
|
|
|
|
'DummyWorker'
|
|
|
|
end
|
|
|
|
|
|
|
|
include ApplicationWorker
|
2016-10-21 12:13:41 -04:00
|
|
|
include PipelineQueue
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2017-08-21 07:05:01 -04:00
|
|
|
it 'sets a default pipelines queue automatically' do
|
|
|
|
expect(worker.sidekiq_options['queue'])
|
2017-08-21 07:49:57 -04:00
|
|
|
.to eq 'pipeline_default'
|
2017-08-21 07:05:01 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
describe '.enqueue_in' do
|
2017-08-21 07:49:57 -04:00
|
|
|
it 'sets a custom sidekiq queue with prefix and group' do
|
|
|
|
worker.enqueue_in(group: :processing)
|
2017-08-21 07:05:01 -04:00
|
|
|
|
|
|
|
expect(worker.sidekiq_options['queue'])
|
2017-08-21 07:49:57 -04:00
|
|
|
.to eq 'pipeline_processing'
|
2017-08-21 07:05:01 -04:00
|
|
|
end
|
2016-10-21 12:13:41 -04:00
|
|
|
end
|
|
|
|
end
|