enqueue_sidekiq_job RSpec块匹配器 安装 # Gemfile group :test do gem 'rspec-enqueue_sidekiq_job' end 用法 检查某个作业是否已排入队列。 expect { AwesomeWorker . perform_async } . to enqueue_sidekiq_job ( AwesomeWorker ) 指定参数 expect { AwesomeWorker . perform_async ( 42 , 'David' ) . to enqueue_sidekiq_job ( AwesomeWorker ) . with ( 42 , 'David' ) 测试计划的工作 使用可链接的匹配器#at和#in : time = 5 . minutes . from_now expect { Aw