diff --git a/test/jobs/sync_job_test.rb b/test/jobs/sync_job_test.rb index a0336ac9d..2b534097b 100644 --- a/test/jobs/sync_job_test.rb +++ b/test/jobs/sync_job_test.rb @@ -12,11 +12,11 @@ class SyncJobTest < ActiveJob::TestCase end test "configured to retry on TwelveData rate limit error" do - # Verify that SyncJob has a rescue handler for Provider::TwelveData::RateLimitError - # The retry_on declaration adds a rescue_from handler + # Verify that SyncJob has retry_on configured for Provider::TwelveData::RateLimitError + # retry_on adds a rescue handler as [exception_class_name_string, proc] handler_found = SyncJob.rescue_handlers.any? do |handler| - handler.is_a?(Hash) && - handler[:exception] == Provider::TwelveData::RateLimitError + handler.is_a?(Array) && + handler[0] == Provider::TwelveData::RateLimitError.name end assert handler_found, "SyncJob should have retry_on configured for Provider::TwelveData::RateLimitError"