Resque :: NoQueueError:必须将作业放入队列

时间:2019-07-11 21:27:26

标签: ruby-on-rails-4 rspec resque

今天早上,我升级了resque(1.26.0)和resque_spec(0.18.1),并带来了许多其他宝石,以试图解决其他问题错误,现在我的很多测试都因该错误而失败。

完整错误:

1) Payment#authorize! should place the order in state 'queued
   Failure/Error: @order.should be_queued
   Resque::NoQueueError:
     Jobs must be placed onto a queue.
   # ./spec/models/payment_spec.rb:77:in `block (3 levels) in <top (required)>'

以下是第77行的相关代码:

describe "#authorize!" do
    before do
      @order = FactoryBot.create :order
      @payment = @order.checkout.payment
    end

    it "should enqueue the XstreetCheckout job with the payment_id" do
      Resque.should_receive(:enqueue_in).with(0.minutes, Job::BackgroundCheckout, @payment.id)
      @order.checkout.start_processing_payment!
    end

    it "should place the order in state 'queued" do
      @order.checkout.start_processing_payment!
      @order.reload
      @order.should be_queued
    end
   end

我做了很多谷歌搜索,并且看到了类似的问题,但是似乎没有什么帮助。我已经尝试将@queue设置为等于东西,尽管我甚至不确定要使用哪个队列,因为在resque_schedule.yml中定义了一堆。

0 个答案:

没有答案