2019-12-26 22:10:19 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2022-10-11 01:57:18 +05:30
|
|
|
require 'rubocop_spec_helper'
|
2018-03-17 18:26:18 +05:30
|
|
|
|
|
|
|
require_relative '../../../rubocop/cop/sidekiq_options_queue'
|
|
|
|
|
2021-03-08 18:12:59 +05:30
|
|
|
RSpec.describe RuboCop::Cop::SidekiqOptionsQueue do
|
2018-03-17 18:26:18 +05:30
|
|
|
it 'registers an offense when `sidekiq_options` is used with the `queue` option' do
|
2021-04-17 20:07:23 +05:30
|
|
|
expect_offense(<<~CODE)
|
|
|
|
sidekiq_options queue: "some_queue"
|
|
|
|
^^^^^^^^^^^^^^^^^^^ Do not manually set a queue; `ApplicationWorker` sets one automatically.
|
|
|
|
CODE
|
2018-03-17 18:26:18 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
it 'does not register an offense when `sidekiq_options` is used with another option' do
|
2021-04-17 20:07:23 +05:30
|
|
|
expect_no_offenses('sidekiq_options retry: false')
|
2018-03-17 18:26:18 +05:30
|
|
|
end
|
|
|
|
end
|