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

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

require 'fast_spec_helper'

RSpec.describe Gitlab::SidekiqMiddleware::DuplicateJobs::Strategies do
  describe '.for' do
    it 'returns the right class for `until_executing`' do
      expect(described_class.for(:until_executing)).to eq(described_class::UntilExecuting)
    end

    it 'returns the right class for `until_executed`' do
      expect(described_class.for(:until_executed)).to eq(described_class::UntilExecuted)
    end

    it 'returns the right class for `none`' do
      expect(described_class.for(:none)).to eq(described_class::None)
    end

    it 'raises an UnknownStrategyError when passing an unknown key' do
      expect { described_class.for(:unknown) }.to raise_error(described_class::UnknownStrategyError)
    end
  end
end