diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-11-28 19:08:30 +0300 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-12-05 13:59:39 +0300 |
commit | 0b15570e497d3c5c515be59a43b686087b985f5c (patch) | |
tree | 759ba4c5764145345dce24509a5faf65c6476b9e /spec/workers/concerns/application_worker_spec.rb | |
parent | 4ca4b0ff702a68a9aed5da70d9170da410eefafa (diff) |
Add ApplicationWorker and make every worker include it
Diffstat (limited to 'spec/workers/concerns/application_worker_spec.rb')
-rw-r--r-- | spec/workers/concerns/application_worker_spec.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/spec/workers/concerns/application_worker_spec.rb b/spec/workers/concerns/application_worker_spec.rb new file mode 100644 index 00000000000..fd434f58602 --- /dev/null +++ b/spec/workers/concerns/application_worker_spec.rb @@ -0,0 +1,27 @@ +require 'spec_helper' + +describe ApplicationWorker do + let(:worker) do + Class.new do + def self.name + 'Gitlab::Foo::Bar::DummyWorker' + end + + include ApplicationWorker + end + end + + describe 'Sidekiq options' do + it 'sets the queue name based on the class name' do + expect(worker.sidekiq_options['queue']).to eq('foo_bar_dummy') + end + end + + describe '.queue' do + it 'returns the queue name' do + worker.sidekiq_options queue: :some_queue + + expect(worker.queue).to eq('some_queue') + end + end +end |