Created
April 9, 2018 14:46
-
-
Save josemrb/f97d40eca58747b53fc63d73f4970ee0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe ApiJob, type: :job do | |
include ActiveJob::TestHelper | |
subject(:job) { described_class.perform_later() } | |
it 'handles status 429' do | |
allow(ApiClient).to receive(:make_request).and_raise(RestClient::RequestFailed) | |
perform_enqueued_jobs do | |
expect_any_instance_of(described_class).to receive(:retry_job).with(wait: 15.seconds) | |
job | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment