I am using the rspec-sidekiq
gem (https://github.com/philostler/rspec-sidekiq) to help test a worker I am writing, but for some reason my test keeps failing.
Here is my Test:
require 'spec_helper'
describe CommunicationWorker do
it { should be_retryable false }
it "enqueues a communication worker" do
subject.perform("foo@bar.com", "bar@foo.com", [1,2,3])
expect(CommunicationWorker).to have_enqueued_jobs(1)
end
end
Here is the error:
1) CommunicationWorker enqueues a communication worker
Failure/Error: expect(CommunicationWorker).to have_enqueued_jobs(1)
expected CommunicationWorker to have 1 enqueued job but got 0
# ./spec/workers/communication_worker_spec.rb:9:in `block (2 levels) in <top (required)>'
I based my low-level test off of their example on their wiki, but it's not working for me... any reason why this wouldn't work?