Welcome to mirror list, hosted at ThFree Co, Russian Federation.

sidekiq_options_queue_spec.rb « cop « rubocop « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e65118ca19212ad9efac922fbce52012af22a6f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# frozen_string_literal: true

require 'fast_spec_helper'

require 'rubocop'
require_relative '../../../rubocop/cop/sidekiq_options_queue'

RSpec.describe RuboCop::Cop::SidekiqOptionsQueue do
  subject(:cop) { described_class.new }

  it 'registers an offense when `sidekiq_options` is used with the `queue` option' do
    expect_offense(<<~CODE)
      sidekiq_options queue: "some_queue"
                      ^^^^^^^^^^^^^^^^^^^ Do not manually set a queue; `ApplicationWorker` sets one automatically.
    CODE
  end

  it 'does not register an offense when `sidekiq_options` is used with another option' do
    expect_no_offenses('sidekiq_options retry: false')
  end
end