title: How can I test something that needs to occur in the future with rspec & sidekiq?
body: <p>Users can checkout from my Rails storefront, thereby creating an <code>order</code>. Assuming the user doesn't cancel, I want to create a repeat order a month later.</p>
  
  <p>Because I believe it is better to look for things to do now rather than schedule things to occur in the future, I want to have something looking for orders that need to be processed and creating a Sidekiq job for each occurrence. Each of these jobs will create a new order with the same contents as the previous order.</p>
  
  <p>Because I want to use TDD, before I go adding Sidekiq to my project or implementing this functionality, I want to write an rspec test that tells me that my jobs are being enqueued at the proper time. I'll then implement the enqueueing and move on to writing a spec that confirms that the job actually creates a new order, at which point I'll go and implement that.</p>
  
  <p>My question is how should I implement the test to ensure that the jobs are being created?</p>
  
  <p>I see that <code>ActiveSupport::Testing::TimeHelpers</code> has replaced Timecop, so I'm all for using that. My first thought would be to do this:</p>
  
  <ol>
  <li>Create order</li>
  <li>Fast forward a month</li>
  <li>Confirm a job was created to process the order that needs to be handled</li>
  </ol>
  
  <p>But I am pretty sure there won't be a job run in this case, so I'm not sure how to proceed.</p>