<commit_before>require "spec_helper"

describe ScheduledWorkerRunner, type: :lib do
  let(:subject) { ScheduledWorkerRunner }
  let(:instance) { subject.new }
  let(:scheduled_workers) { [UpdateExpiredInvoiceWorker] }
  include_context :scheduled_worker
  include_examples :scheduled_worker_tests

  it "is the correct queue and frequency" do
    expect(subject.sidekiq_options["queue"]).to eq "high_priority" # overrides default
    expect(subject.frequency).to be > 1.minute
  end

  it "has correct scheduled workers" do
    expect(subject.scheduled_workers).to eq scheduled_workers + [subject]
  end

  describe "perform" do
    it "schedules all the workers" do
      clear_scheduled_history
      expect(subject.scheduled_workers.count).to be > 0
      instance.perform
      subject.scheduled_non_scheduler_workers.each do |worker|
        expect(worker.jobs.count).to eq 1
      end
    end
  end
end<commit_msg>Fixed broken ScheduledWorkerRunner spec<commit_after>require "spec_helper"

describe ScheduledWorkerRunner, type: :lib do
  let(:subject) { ScheduledWorkerRunner }
  let(:instance) { subject.new }
  let(:scheduled_workers) { [UpdateExpiredInvoiceWorker] }
  include_context :scheduled_worker
  include_examples :scheduled_worker_tests

  it "is the correct queue and frequency" do
    expect(subject.sidekiq_options["queue"]).to eq "high_priority" # overrides default
    expect(subject.frequency).to be > 1.minute
  end

  it "has correct scheduled workers" do
    expect(subject.scheduled_workers).to eq scheduled_workers + [UpdateOrganizationPosKindWorker, subject]
  end

  describe "perform" do
    it "schedules all the workers" do
      clear_scheduled_history
      expect(subject.scheduled_workers.count).to be > 0
      instance.perform
      subject.scheduled_non_scheduler_workers.each do |worker|
        expect(worker.jobs.count).to eq 1
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.08056872037914692, 'fraction_numerical': 0.00315955766192733, 'mean_word_length': 4.234159779614325, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6604038', 'n_tokens_mistral': 572, 'n_tokens_neox': 553, 'n_words': 141}