Most stuff I can find related is about testing that the background job is scheduled like this question.
However, I need to write a feature test that actually waits for the execution of the background job, so let's say:
BatchWorker.perform_in(30.minutes)
I will need to write a feature test that makes some assertions based on the results of this job that will execute in 30 minutes. How to do that?
UPDATE
Just to clarify... I don't need to test if the job is enqueued, for example with rspec-sidekiq gem you can do something like
Awesomejob.perform_in 30.minutes, 'Awesome', true
# test with...
expect(AwesomeJob).to have_enqueued_sidekiq_job('Awesome', true).in(30.minutes)
This is not what I need... I need to make an assertion on the page with capybara after the execution of the job.