Sha256: 3b6fd0bdd499f5e3b7736e9d0594923176073648bfc00c2bf6bebc91e2c43ef8

Contents?: true

Size: 615 Bytes

Versions: 6

Compression:

Stored size: 615 Bytes

Contents

require 'test_helper'

module Workarea
  class ScheduledJobsTest < TestCase
    def test_remove_dead_jobs_after_initialize
      Sidekiq::Cron::Job.create(name: 'Foo', klass: 'Bar', cron: '1 * * * *')

      assert_includes(Workarea.redis.keys('cron_job:*'), 'cron_job:Foo')
      refute_nil(Sidekiq::Cron::Job.find('Foo'))

      ScheduledJobs.clean

      refute_includes(Workarea.redis.keys('cron_job:*'), 'cron_job:Foo')
      assert_nil(Sidekiq::Cron::Job.find('Foo'))
    end

    def test_redis_not_available
      Workarea.stubs(skip_services?: true)
      assert_nil(ScheduledJobs.clean)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
workarea-core-3.5.27 test/lib/workarea/scheduled_jobs_test.rb
workarea-core-3.5.26 test/lib/workarea/scheduled_jobs_test.rb
workarea-core-3.5.25 test/lib/workarea/scheduled_jobs_test.rb
workarea-core-3.5.23 test/lib/workarea/scheduled_jobs_test.rb
workarea-core-3.5.22 test/lib/workarea/scheduled_jobs_test.rb
workarea-core-3.5.21 test/lib/workarea/scheduled_jobs_test.rb