mirror of
https://github.com/we-promise/sure.git
synced 2026-05-09 13:45:01 +00:00
Copilot assist - correct RateLimitError test failure (#921)
* Copilot assist - correct RateLimitError test failure * Rather than hardcoding, in case it's different --------- Co-authored-by: Juan José Mata <jjmata@jjmata.com>
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user