Skip to content

Instantly share code, notes, and snippets.

@andyt
Created July 23, 2014 11:33
Show Gist options
  • Save andyt/99fa995b028bf634a2fe to your computer and use it in GitHub Desktop.
Save andyt/99fa995b028bf634a2fe to your computer and use it in GitHub Desktop.
Testing Sidetiq with sidekiq/testing
Sidekiq::Testing.fake! do
expect(
Sidetiq::Handler.new.dispatch(CreateStatementsFromBillingDetails, Time.now - 1800)
).to be_truthy
expect(
Sidetiq::Handler.new.dispatch(CreateStatementsFromBillingDetails, Time.now - 900)
).to be_truthy
end
expect(CreateStatementsFromBillingDetails.jobs.size).to eq 2
expect(CreateStatementsFromBillingDetails.next_scheduled_occurrence).to be > 0
expect(CreateStatementsFromBillingDetails.last_scheduled_occurrence).to be > 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment