Sha256: 1dff530130289854783d4b65af407fbd2a75d1f1ba87014a933035ee8398b16f
Contents?: true
Size: 1.65 KB
Versions: 12
Compression:
Stored size: 1.65 KB
Contents
require 'spec_helper' RSpec.describe SidekiqUniqueJobs do describe '.configure_middleware' do it 'configures both client and server middleware' do expect(described_class).to receive(:configure_server_middleware) expect(described_class).to receive(:configure_client_middleware) described_class.configure_middleware end end describe '.configure_server_middleware' do let(:server_config) { class_double(Sidekiq) } let(:server_middleware) { double(Sidekiq::Middleware::Chain) } let(:client_middleware) { double(Sidekiq::Middleware::Chain) } it 'adds client and server middleware when required' do expect(Sidekiq).to receive(:configure_server).and_yield(server_config) expect(server_config).to receive(:client_middleware).and_yield(client_middleware) expect(client_middleware).to receive(:add).with(SidekiqUniqueJobs::Client::Middleware) expect(server_config).to receive(:server_middleware).and_yield(server_middleware) expect(server_middleware).to receive(:add).with(SidekiqUniqueJobs::Server::Middleware) described_class.configure_server_middleware end end describe '.configure_client_middleware' do let(:client_config) { class_double(Sidekiq) } let(:client_middleware) { double(Sidekiq::Middleware::Chain) } it 'adds client middleware when required' do expect(Sidekiq).to receive(:configure_client).and_yield(client_config) expect(client_config).to receive(:client_middleware).and_yield(client_middleware) expect(client_middleware).to receive(:add).with(SidekiqUniqueJobs::Client::Middleware) described_class.configure_client_middleware end end end
Version data entries
12 entries across 12 versions & 1 rubygems